4 AnswersNew Answer
Its because for list, just pure = creates an exact copy. An exact copy will copy whatever the first term is only if methods are used, not operations. If you don't want it, create a dry copy with [:]
the cause is...... list2 assigned list1's value😊. it changes by list1.
@Pegasus thank you! I'd like to see such an explanation in the course, I think it's important for all learners
# you can use id() and 'is' to examine the relationships my_list = [1, 2, 3] # this is assignment, an additional reference to the same object my_list_reference = my_list print('These are identical references', my_list is my_list_reference) print('they point to same object in memory ?', id(my_list_reference) == id(my_list)) # you can make independent objects(copies) via the constructor my_list_copy = list(my_list) print('these are identical refernces?', my_list_copy is my_list) print('they point to same object in memory?', id(my_list_copy) == id(my_list))