QuestenaPractice that shows what to review next
Question 48

After `copy = data.copy()` for a dictionary with a nested list value, which statements are true? Select all that apply.

  1. The outer dictionaries are distinct objects.Correct answer
  2. Every nested object is recursively duplicated.
  3. A nested list value can still be shared.Correct answer
  4. `copy` is merely another name for the same outer dictionary.

Explanation

The call constructs a separate outer dictionary, but its values are copied as references, so a nested list remains shared. Calling this a deep copy incorrectly assumes recursive duplication, while calling it a complete alias ignores the new outer mapping.

Continue with this test

Start practice
Question 48: After `copy = data.copy()` for a dictionary with a nested… · Python Fundamentals · Questena