Conditions & Conditional Statements Flashcards
In programming, conditions are statements that are either what?
T or F
Equals symbol
==
Does not equal symbol
!=
Less than
<
Less than or equal to
<=
Greater than symbol
>
Greater than or equal to
> =
How do you check a value?
==
How do you set a value?
=
The code under the “if” statement is run if the statement is what?
T
The code under the “else” is run if the statement is what?
False
elif is used to check if what?
Multiple conditions might be true
elif stands for?
Else if
When making a comparison what should you use?
==
When you write n == 6 what are you doing?
Setting the value of n
When you write m = 17 what are you doing?
Changing the value of m
How can you combine boolean values using standard concepts?
“and”
“or”
“not”
Which is evaluated first and/or?
And
Conditional statements are often referred to as what?
If-then statements
All numbers are treated as true except what?
0
All strings are treated as true except what?
An empty string
Generally empty sequences are what?
Falsey & truthy
With the and operator all conditions must be what?
True
With the or operator how many conditions need to be True?
Only 1
When doing if elif and else statements which one will get executed?
Only the FIRST true condition