Variables in python work differently than they do in C. While in C, a statement like "x = 5;" means that the value 5 is stored in a memory position labeled as x, in Python, variables are references to objects in which values are stored. So, a statement like "x = 5" in python implies that x is a reference to an object containing the value 5.
One way how this leads to different outcomes is to take the example of variable reassignment.
>>> x = [1, 2, 3]
>>> y = x
>>> x.append(4)
>>> x
[1, 2, 3, 4]
>>> y
[1, 2, 3, 4]
>>>
As you can see in the above code, if there are two variables i.e., two references to a value, any mutation to the value in-place leads to the change being reflected in both the variables.