demo_iterator2.py:
mystr = "banana" myit = iter(mystr) print(next(myit)) print(next(myit)) print(next(myit)) print(next(myit)) print(next(myit)) print(next(myit))
C:\Users\My Name>python demo_iterator2.py
b
a
n
a
n
a