Say I have some variable x=2
and it is stored in 2 lists in different slots:
a=[1,x,3]
and b=[x,6,7,8]
When I print a
and b
I get: a=[1,2,3]
and b=[2,6,7,8]
But if I now set x=0
, printing a
and b
still gives a=[1,2,3]
and b=[2,6,7,8]
I would like to get: a=[1,0,3]
and b=[0,6,7,8]
Is this possible in Python 2.7? If it is, please also describe its limits in terms of other data types, such as sets, arrays, tuples, and so on.
Thank you!