I'm facing some problems with variables in my program. I need to keep two or three versions of a list that changes during loop evaluation. For example:
x=[0]
y=[0]
while True:
y=x
x[0]+=1
print (y,x)
input()
As I press Enter it shows [1] [1]; [2] [2]; [3] [3]...
But I need to keep the previous state of the list in a variable: [0] [1]; [1] [2]; [2] [3] ...
What should the code be?