Conditionals
Conditionals allow us to execute blocks of code based on certain boolean conditions. They include if, else, and elif.
Lets take a look at the basic if conditional, which will execute the block if the condition in parentheses evaluates to true.
We can also chain conditionals together by using elif and else. The second elif (else if) block will execute only if its conditional passes and the first conditional failed. The third else statement will always execute as long as the first two conditionals failed.
Conditionals can also use expressions in their check statement.
Last updated