Control Flow
Fill this in later
Comparator
Check if a value is (or is not) equal to, greater than (or equal to), or less than (or equal to)
Eg.
Boolean Operators
Compare statements and result in boolean values. Three types:
Eg.
Order of Operations for Boolean Operators
Conditional statement syntax
a statement that executes some specific code after checking if its expression is true or false
Eg “if”, “Else”, “Elif”
“IF/Else” pair? Example?
When running “If” as a conditional statement, “Else” is used to provide an option in case the “If” expression is not true.
Eg. “If this expression is true, run this indented code block; otherwise, run this code after the else statement.”
“Elif” statement? Example?
Conditional statement; provides an alternative to an “if” statement in case it is false
Eg. “Otherwise, if the following expression is true, then do this.”
def greater_less_equal_5(answer):
if answer > 5:
return 1
elif answer < 5:
return -1
else:
return 0print greater_less_equal_5(4) print greater_less_equal_5(5) print greater_less_equal_5(6)