Lists are mutable. It's the same object i.e. same id, but because lists sa mutable, the element at index 0 has changed.
c = [1, 2, 3] print(id(c), c) def demo(): c[0] = 5 demo() print(id(c), c)
Output:139939046686920 [1, 2, 3]
139939046686920 [5, 2, 3]
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs