Iterables and Iterators
for loops follow this general form:
for <var> in <iterable>: <statement(s)>
In this lesson, you’ll learn how a
for loop can be used to iterate or loop over objects such as sets, lists, strings, and dictionaries. You’ll also see that not every Python object can be iterated over, for example integers and floats don’t support iteration. In the next lesson, you’ll learn what an iterator actually is.
Comments & Discussion
Become a Member to join the conversation.