Deep copy by hand

Report a typo

Have a look at this code snippet:

fives = [[[555]]]  # 1
my_copy = fives    # 2
...                # 3
...                # 4
...                # 5

Place the commands below in the right order so that by the end of the program, the list fives stays unchanged and my_copy is a deep copy of fives.

Put the items in the correct order
my_copy = my_copy.copy()
my_copy[0][0] = my_copy[0][0].copy()
my_copy[0] = my_copy[0].copy()
___

Create a free account to access the full topic