Recall & Review
beginner
What does the
and operator do in Python?The
and operator returns True only if both conditions on its sides are True. Otherwise, it returns False.Click to reveal answer
beginner
What is the result of
True or False in Python?The result is
True because the or operator returns True if at least one condition is True.Click to reveal answer
beginner
Explain the
not operator in Python.The
not operator reverses the value of a condition. If the condition is True, not makes it False, and vice versa.Click to reveal answer
beginner
What will
False and True return?It will return
False because and needs both sides to be True to return True.Click to reveal answer
beginner
How do logical operators help in decision making in code?
Logical operators combine multiple conditions to decide if a block of code should run. They help check if one or more conditions are true or false.
Click to reveal answer
What does the expression
True and False evaluate to?✗ Incorrect
The
and operator returns True only if both sides are True. Here, one side is False, so the result is False.Which operator returns
True if at least one condition is true?✗ Incorrect
The
or operator returns True if any one or both conditions are True.What is the result of
not True?✗ Incorrect
The
not operator reverses the value. So not True is False.Which logical operator would you use to check if two conditions are both true?
✗ Incorrect
The
and operator checks if both conditions are true.What does
False or False evaluate to?✗ Incorrect
The
or operator returns True if at least one side is true. Here both are false, so result is False.Explain how the
and, or, and not operators work in Python with simple examples.Think about how these operators combine or reverse true/false values.
You got /4 concepts.
Describe a real-life situation where you might use logical operators in a program.
Consider checking multiple conditions before doing something, like checking weather and time before going outside.
You got /3 concepts.