Logical Comparisons Flashcards

1
Q

How many Comparison Operators are there in python?

A
  1. ==
  2. !=
  3. >
  4. <
  5. > =
  6. <=
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

_________ compare variables and output a Boolean value (True or False).

A

Comparison Operators

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

Chained Comparison Operators

How many statements are there in chained comparison operators?

A

and

or

not

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

____ is used to make sure two checks have to be true in order for the total check to be true.

A

and

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

1 == 2 or 2<3

True.

this is because of the ___ operator

A

or

Because, we only need one or the other to be true.

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

Run a code as an example for

and statement.

A

1 < 2 < 3 (instead of this)

OUTPUT : True

1<2 and 2<3

OUTPUT : True

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

Run a code for or statement.

A

1 == 2 or 2<3

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

When u want to get the result which is opposite to the real one, which operator is used?

A

not

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

Run a code for not statement.

A

1 == 2

OUTPUT: False

not 1 == 2

OUTPUT: True

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