In python, the code
x = 0
y = x
y = 1
print x
returns "0" while the code
x = [0]
y = x
y[0] = 1
print x
returns "[1]". Why does python treat lists so differently from integers and what can I do to force it to treat the bottom "x" as it does the top "x"? It seems like the '='s in the respective second lines mean different things - the top one only affects y while the bottom somehow binds x to y. So maybe I need to use a different symbol in the bottom code?