I'm trying to wrap my head around the concept of shallow and deep copies in python. From what I see on the internet, slicing a list creates a shallow copy. Hence, I decided to see it for myself by running the code below:
lista = [1,2,3,4,5]
listb = lista[1::]
listb[3] = 9
print(listb)
print(lista)
The output is that listb is now [2,3,4,9] which is what I expected. However, lista is still [1,2,3,4,5] when I expected it to be [1,2,3,4,9]. Is there something I missed out or misunderstood? Thanks