Pythondex

Quiz

Logical Operators Quiz

Which statement about the 'and' operator in Python is correct?

It returns True if at least one operand is True
It returns True only if both operands are True
It inverts the boolean value of a single operand
It always returns False

Which operator returns True if at least one operand is True?

and
or
not
xor

What does the 'not' operator do in Python?

Inverts the boolean value
Performs logical AND
Performs logical OR
Checks equality