Python comparison operators Flashcards

1
Q

True/False: Comparison operators are not restricted to numbers.

A

True, comparison operators extend to strings.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Name 3 logical operators.

A

And, or, not.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

For an and chain operator, how many statements must be true?

A

All.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

For a or chain operator, how many statements must be true?

A

Only one statement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly