python iterable objects code example
Example 1: python iterator
pies = ["cherry", "apple", "pumpkin", "pecan"]
iterator = iter(pies)
print(next(iterator))
#prints "cherry" because it's the current one being iterated over
Example 2: create iterator object python
iterable = ['Apple', 'Banana', 'Cherry']
iter(iterable)