It is very common when you first start learning python to be baffled by the fact that copying a list into a secondary variable, and then modifying your copy of the lists will also modify the base list.
This is actually because making a copy of the list by setting another variable equal to the first variable you stored the list in is just pointing both variables at the same set of data. To get around this and get a real copy of a list that you can mess with independently from the original list, you need to import the module 'copy'. Then you can use the easy copy.deepcopy(YourListHere) command to get a real duplicate made that can be edited independantly!
Hope you guys found this useful, thanks for watching and don't forget to like and subscribe for more great content!
Ещё видео!