What Makes Something Iterable
A structure is iterable if you can walk through it one item at a time, from beginning to end.
Lists and arrays are iterable. Strings are iterable, a string is a sequence of characters. Dictionaries and objects are iterable through their keys. Sets are iterable. A single number is not. There's nothing to walk through.
✦ Why this concept comes before loops
A loop doesn't work on 'anything.' It works on iterables. Once you know which structures are walkable and what you get on each step, every loop in the next two modules becomes obvious instead of magical.
Mark this lesson complete
Signed in, your progress follows you to every device.