original[0].append(["marsupials"])
index[0] is the original list, so "marsupials" is appended to that.
to see this isolated, add after the append add:
print(original[0])
Shallow copy question
|
|
Messages In This Thread |
Shallow copy question - by Calflo - Dec-01-2022, 05:09 PM
RE: Shallow copy question - by Larz60+ - Dec-01-2022, 07:08 PM
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Why is the copy method name in python list copy and not `__copy__`? | YouHoGeon | 2 | 249 |
Apr-04-2024, 01:18 AM Last Post: YouHoGeon |