Can someone explain why the example with integers results in different values for x and y and the example with the list results in x and y being the same object?
That's because when you have a list or a tuple in python you create a reference to an object.
When you say that y = x you reference to the same object with y as x does.
So when you edit the object of x y changes with it.