I need to remove a item from a list and then add it again in the same position, like this:
x = ['a','b','c']
x2 = ['a','b','c']
x.remove(x[1])
...
x = x2
x.remove(x[0])
...
#expected result:
x == ['b','c'] #True
x2 == ['a','b','c'] #True
#real result
1. example == True
2. example == False
That happens because when I use x = x2
I created an instance of x2
on x
, but I just wanna assign x2
raw value to x
. How can I do it?