if
, elif
, and else
keywords for conditionals.if
Statementif
statement checks a condition. If the condition is True
, the block of code under it is executed.if-else
Statementelse
block is executed if the if
condition is False
.if-elif-else
Statementelif
(else-if) statement allows you to check multiple conditions.else
block is executed if none of the if
or elif
conditions are True
.if
statements inside other if
statements to check for more complex conditions.and
, or
, not
) are used to combine multiple conditions.and
: Both conditions must be True
.or
: At least one condition must be True
.not
: Inverts the condition.if-else
statements in a single line.if
Statement:
if-else
Statement:
if-elif-else
Statement: