Python โ From Basics to Advanced ยท Flow Control
The for Loop
Flow Control
Introduction
A for loop in Python iterates over items โ lists, strings, range, dicts, files. You will learn the range/enumerate/zip idioms, the for...else clause, and why you should NOT mutate a collection while iterating it.