QuestenaÜben und erkennen, was als Nächstes dran ist
Frage 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.Richtige Antwort
  2. Every nested object is recursively duplicated.
  3. A nested list value can still be shared.Richtige Antwort
  4. `copy` is merely another name for the same outer dictionary.

Erklärung

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.

Mit diesem Test weitermachen

Übung starten
Frage 48: After `copy = data.copy()` for a dictionary with a nested… · Python Fundamentals · Questena