6/30/22

Python Conditionals

Conditionals are used to carry out functions which are depending on set rules I e conditions. To work with conditionals, you'll need to declare the if ..... else statement. 


If statement
This is a single conditional.
Your code continues to run until it reaches the block of the if code, if the condition favors the code, the statement within this block is run else it's skipped.

If ..... else statement
In this block, the condition is passed, and any variable that favors said condition is passed through the statement.
Another block is created, the else block, and the statement within it is passed if the condition  is not favoured.


If ..... elif ...... else statement
This statement allows you to pass multiple conditions.


|

Blog Archive