when adding an element to the history list it changes the rest by the element that I add
inputt="^<<<"
cordenadas=[0,0]
historial=[]
for i in inputt:
if i == "^":
cordenadas[0]+=1
elif i== "v":
cordenadas[0]-=1
elif i== "<":
cordenadas[1]-=1
elif i== ">":
cordenadas[1]+=1
historial.append(cordenadas)
print(historial)
this is the output
[[1, 0]]
[[1, -1], [1, -1]]
[[1, -2], [1, -2], [1, -2]]
[[1, -3], [1, -3], [1, -3], [1, -3]]