demo_ref_iter.py:
x = iter(["apple", "banana", "cherry"]) print(next(x)) print(next(x)) print(next(x))
➜ begtut>python demo_iter.py
apple
banana
cherry