Iterables vs Iterators
An iterable is any object you can loop over (list, string, range). An iterator is an object that produces values one at a time with next().
An iterable is any object you can loop over (list, string, range). An iterator is an object that produces values one at a time with next().
my_list = [1, 2, 3] # iterable
it = iter(my_list) # iterator
print(next(it)) # 1
print(next(it)) # 2
print(next(it)) # 3
iter() converts an iterable to an iterator; next() fetches the next value.