Control Structures in Python
Control Structures in Python
Technical Training
Titus
logical conditions from mathematics
• Equals: a == b
• Not Equals: a != b
• Less than: a<b
• Less than or equal to: a <= b
• Greater than: a>b
• Greater than or equal to: a >= b
if statements
• if statement
• if..else statements
• nested if statements
• if-elif ladder
if statement - variants
An if statement consists of a boolean expression followed by one
or more statements.
if...else statements
An if statement can be followed by an optional else statement,
which executes when the boolean expression is FALSE.
nested if statements