Robotics & Artificial Intelligence
What would be the result of the following expression?
15 > 12 and 2 < 1
- True
- False
- Error
- None of these
Python Control Flow
3 Likes
Answer
False
Reason — The expression contains the logical operator and, which returns True only if both conditions are true.
= 15 > 12 and 2 < 1
= True and False
= False
Answered By
3 Likes
Related Questions
In Python, which keyword is used to terminate a loop immediately?
- exit
- return
- break
- continue
From the following, which is not a comparison operator in Python?
- ==
- !=
- >=
- <>
Fill in the blanks:
- ……………. is used to repeat a block of code until a certain condition is met.
- ……………. statement in a loop is used to break the execution of the loop.
- ……………. keyword is used to create an empty loop.
- ……………. statement is used to skip the current iteration of the loop and move to the next.
- ……………. loop is used to iterate over a sequence of items.
Explain the use of break statement in Python with the help of an example.