i see tea Flashcards
Python supports the usual logical conditions from mathematics:
Equals: a == b
a == b
a != b
a > b
a < b
equals
not equal to
greater than
less than
Python relies on ___to define scope in the code. Other programming languages often use curly-brackets for this purpose.
indentation (whitespace at the beginning of a line)
is Python’s way of saying “if the previous conditions were not true, then try this condition”.
elif
catches anything which isn’t caught by the preceding conditions.
Else
catches anything which isn’t caught by the preceding conditions.
Else
If you have only one statement to execute, you can put it on the same line as the if statement
Short hand if
If a > b: print (“ a is greater than b”)
is logical operator, and it is used to combine conditional statements
And
Is logical operator, and it is used to reverse the result of the conditional statements
Not
If you have if statements inside if statements, this is called
nested if statements
If statements cannot be empty, but if you for some reason have an if statement with no content, put in the
pass statement