nerdexam
Python_Institute

PCPP-32-101 · Question #56

Which sentence is false?

The correct answer is A. It takes less time to make a deep copy than a shallow copy of an object. Making a deep copy takes more time than a shallow copy because it recursively copies all nested objects, whereas a shallow copy only copies the top-level object.

Advanced OOP

Question

Which sentence is false?

Options

  • AIt takes less time to make a deep copy than a shallow copy of an object
  • BThe [:] operator cannot be applied to dictionaries.
  • CThe [:] operator makes a shallow copy of every list or tuple-type object.
  • DThe copy() method from the copy module makes a shallow copy of every object.

How the community answered

(32 responses)
  • A
    78% (25)
  • B
    6% (2)
  • C
    3% (1)
  • D
    13% (4)

Explanation

Making a deep copy takes more time than a shallow copy because it recursively copies all nested objects, whereas a shallow copy only copies the top-level object.

Topics

#deep copy#shallow copy#copy module#slice operator

Community Discussion

No community discussion yet for this question.

Full PCPP-32-101 Practice