Python comparison operators Flashcards
1
Q
True/False: Comparison operators are not restricted to numbers.
A
True, comparison operators extend to strings.
2
Q
Name 3 logical operators.
A
And, or, not.
3
Q
For an and chain operator, how many statements must be true?
A
All.
4
Q
For a or chain operator, how many statements must be true?
A
Only one statement.
5
Q
What does the not chain operator do?
A
It returns the opposite boolean of the statement.
Ex. In: 1 == 1
Out: True
In: not 1 == 1
Out: False