Introduction to Python – Control Flow
If Statement

For Statement
- Python’s for statement iterates over the items of any sequence (a list or a string), in the order that they appear in the sequence.

Range Function
- Iterating over a sequence of numbers

Break Statement
Breaks out of the innermost loop.
- Loop statements may have an else clause.
- Using for or when the condition becomes false with while, but not when the loop is terminated by a break statement.

Continue Statement

Pass Statement
- The pass statement does nothing. It can be used when a statement is required syntactically but the program requires no action.
- It can also be used as a placeholder for a future class definition.

Defining Functions
- A function definition associates the function name with the function object in the current symbol table. The interpreter recognizes the object pointed to by that name as a user-defined function. Other names can also point to that same function object and can also be used to access the function.

Leave a Reply