← Quiz: References and Copying: all 10 questions
Quiz: References and Copying · Question 6 of 10
A function does items = [] on its parameter. What does the caller's list look like afterwards?
A function does items = [] on its parameter. What does the caller's list look like afterwards?
- A.It becomes empty
- B.It is unchanged
- C.It becomes None
- D.Python raises an error
Answer & explanation
Correct answer: It is unchanged
Reassigning a parameter only moves the local name. The caller's object is untouched.
Can you get the rest right without peeking?
Take the timed Quiz: References and Copying quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →