The following table shows all the ways of implementing if statements:
Statement |
Description |
if/then statement |
An if/then statement consists of a Boolean expression followed by one or more statements. |
if/then/else statement |
An if/then statement can be followed by an optional else statement, which executes when the Boolean expression is false. |
if/then/elif/else statement |
An if/then/elif/else statement allows you to have multiple else statements. |
Nested if statements |
You can use one if or else if statement inside another if or else if statements. |