Consider:
>>> lst = iter([1,2,3]) >>> next(lst) 1 >>> next(lst) 2
So, advancing the iterator is, as expected, ha
What is happening is that next(a) returns the next value of a, which is printed to the console because it is not affected.
next(a)
What you can do is affect a variable with this value:
>>> a = iter(list(range(10))) >>> for i in a: ... print(i) ... b=next(a) ... 0 2 4 6 8