If I execute the following code:
l = ["A", "B", "C"]
for i in range(len(l)):
e = l.pop(0)
l.append(e)
print(l)
The output is as expected and iterates the list as expected placing the first element at the end:
['B', 'C', 'A']
['C', 'A', 'B']
['A', 'B', 'C']
HOWEVER, if I attempt to build a data structure to store the lists:
fl = []
l = ["A", "B", "C"]
for i in range(len(l)):
e = l.pop(0)
l.append(e)
fl.append(l)
print(fl)
The output is not as expected:
[['A', 'B', 'C'], ['A', 'B', 'C'], ['A', 'B', 'C']]
Can anyone please explain this?