Control Structures
Make a program decide things and repeat work: branching, loops, and list comprehension.
Articles
1
Branching with IF, ELIF, ELSE in Python
A conditional statement runs a command only when its condition holds. In Python, the if statement handles that job.
2
Repetition with the FOR Loop in Python
A for loop is a loop where you already know when it starts and when it ends.
3
Repetition with the WHILE Loop in Python
Unlike the for loop, a while loop uses a boolean condition as its controller.
4
The BREAK and CONTINUE Statements in Python
Python has the break and continue statements to handle special cases in control structures.
5
Branching with the Ternary Operator in Python
In Python the ternary operator shortens an assignment that involves an IF ELSE condition.
6
List Comprehension in Python
List comprehension is the ternary operator in Python that shortens the process of initializing a list variable.