I am confused why the iteration code works when I assign L to iter(x), and then next(L) to iterate through the x list. As can be seen below:
x=[1,2,3,4,5]
>>> L=iter(x)
>>> next(L)
1
>>> next(L)
2
>>> next(L)
3
>>> next(L)
4
>>> next(L)
5
>>> next(L)
But when I manually write next(iter(x)) to iterate through the x list, it does not work:
next(iter(x))
1
>>> next(iter(x))
1
>>> next(iter(x))
1