I have started learning Python. So I tried to run the following program:
nom = [1, 2, 3, 4, 5, 6]
for x in nom:
print(nom)
nom.pop(1)
print(nom)
I expected to get 1 printed at the end , but what I got is:
[1, 2, 3, 4, 5, 6]
[1, 3, 4, 5, 6]
[1, 4, 5, 6]
[1, 5, 6]
As the loop seems interrupted in midway. Why is that? please explain.