0

Here is my code:

list1 = ["dog", "cat"]
list2 = list1 
list2.append ("fish") 
print(list1)
print(list2)  # both list1 and list2 will be [“dog”, “cat”, “fish”].

I do understand why print(list1)>>> [“dog”, “cat”, “fish”].

But I do not understand why print(list2)>>> [“dog”, “cat”, “fish”].

Could someone explain it please?

jonrsharpe
  • 107,083
  • 22
  • 201
  • 376
Betty
  • 19
  • 2

0 Answers0