🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.It becomes empty
  2. B.It is unchanged
  3. C.It becomes None
  4. 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 →