Core Concept Mastery • Python Visual Series Module
The for loop lets you repeat a block of code once for each item in a sequence — such as a list, a string, or a range of numbers. Python reads the sequence from left to right, assigns each item to a loop variable, and runs the indented body before moving to the next item. When every item has been visited, the loop ends and execution continues with the next unindented line. The built-in range() function is the most common way to generate a sequence of numbers for counting loops.