The for LoopΒΆ

Python’s for loop solves this for us. Let’s say we have some friends, and we’d like to send them each an email inviting them to our party. We don’t quite know how to send email yet, so for the moment we’ll just print a message for each friend:




(partyprint)

the loop body is executed here 7 times, and each time f will refer to a different friend.

Next Section - Flow of Execution of the for Loop