- Iterables have __iter__ method, which returns a iterator.
- Iterators have __iter__method (returns themselves, since they’re iterators), and __next__ method.
- Generators functions (functions with yield statement) return a iterator after being called. You can write __iter__ in iterables as a generator function.
- Practice: Spring 2017 Final Q9 Solution
*list takes an iterable and return a list whose items are the same and in the same order as iterable’s items.
- Summer 2016 Q8 Solution