← Quiz: References and Copying: all 10 questions
Quiz: References and Copying · Question 10 of 10
Which statement about a shallow copy of a list is true?
Which statement about a shallow copy of a list is true?
- A.It copies the inner objects but not the outer list
- B.It creates a new outer list whose items are the same objects as before
- C.It is exactly the same as writing b = a
- D.It only works for lists of numbers
Answer & explanation
Correct answer: It creates a new outer list whose items are the same objects as before
A shallow copy is a new container holding the same item references.
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 →