1. Home
  2. Data Science
  3. Python
  4. Why use copy.deepcopy() instead of copy.copy() for a list…

Added 2 Nov 2026

Why use copy.deepcopy() instead of copy.copy() for a list of lists?

  1. To copy the list faster using less memory
  2. To remove duplicate items while copying
  3. To convert the list into an immutable tuple
  4. To copy the inner lists as well Correct answer

Correct answer

D. To copy the inner lists as well

18 views

MCQSEXAM

Explanation

A shallow copy creates a new outer list that still points to the same inner lists, so editing one affects both. deepcopy recursively copies every nested object.

Reference

Asked in: NTS, Python Developer Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is D? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs