I am trying to understand what happens when I assign a list (list1) into another variable (list2) and concatenate a third list with (list3).
list1 = [3,4]
list2=list1 # shallow copy/hard copy
list1 = list1 + [10,11]
print(list1)
print(list2)
If I apply the Shallow copy or Hard copy concept it should print
[3, 4, 10,10]
[3, 4, 10,11]
But in practice I get
[3, 4]
[3, 4, 10, 11]
Can anyone please explain what is happening in this code snippet? I use Python 3.6