x=[0,1,2,3,4]
x.append(x)
print(x)
Output:
[0, 1, 2, 3, 4, [...]]
I think the output should be:
[0, 1, 2, 3, 4, [0, 1, 2, 3, 4]]
But if I change the code into:
x=[0,1,2,3,4]
y=[0,1,2,3,4]
x.append(y)
print(x)
The output then makes sense.Can you explain that to me?