1/4
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
What are the 3 logical operators and what do that do?
“Or” - at least one condition must be true
“And” All conditions must be true
“Not” Inverts or reverses the condition (not True, not False.
What is a logical operator?
A logical operator allows us to check multiple conditions
What is a conditional expression?
A one-liner shortcut using an If Else statement (AKA Ternary operator)
Print or assign one of two values based on the condition
How do you write an conditional expression?
X if condition else Y
Examples:
Num = 5
print( “EVEN” if Num % 2 == 0 else “Negative)