Iterables and iterators
An iterable is anything you can loop over: a list, a string, a dict, a file. An iterator is the object that does the looping. It hands out one item at a time and remembers where it is.
iter(x) gets an iterator from an iterable. next(it) gets the next item.
When there are no more, next raises StopIteration. A for loop is just
that: call iter once, call next until StopIteration, then stop quietly.
The surprise: an iterator is used up after one pass. Loop over it a second
time and you get nothing, with no error. A list can be looped many times; an
iterator from iter, map, zip, or a file only once. This causes real bugs
when a function loops over its input twice.
next(it, default) returns default instead of raising at the end.
Run it, then add a third loop over it and see that it prints nothing.