01 / 06
The same writing worked on all of them
You have used for on all sorts of things by now: lists, strings, dictionaries, range, files. Every one of them looped the same way.
That is not luck. Python is built for it. This chapter opens up the machinery and looks inside.
for fruit in ["apple", "orange"]: print(fruit)for letter in "hi": print(letter)Result
apple orange h i