Control Flow#
Programming languages define statements to control the flow of execution of the program
Control flow constructs in Python
Conditional statements
if
andmatch
Iteration statements or loops
Count-controlled loops
The
for
statementIterates over each element of an iterable object (e.g., sequence datatypes)
Condition-controlled loops
The
while
statementExecutes a code repeatedly as long as a condition stays true
The
if
,match
,for
, andwhile
statements are compound statementsTypically span multiple lines of code