Informatics Practices
What is the result of this statement:
10>5 and 7>12 or not 18>3
- 10
- True
- False
- None
Python Funda
1 Like
Answer
False
Reason — The expression evaluates as follows: 10 > 5 is True because 10 is greater than 5. 7 > 12 is False because 7 is not greater than 12. 18 > 3 is True because 18 is greater than 3, and not True results in False. Combining these using Python's operator precedence, 10 > 5 and 7 > 12 evaluates to False (True and False). Then, False or not True evaluates to False (False or False). Therefore, the entire expression 10 > 5 and 7 > 12 or not 18 > 3 ultimately evaluates to False.
Answered By
3 Likes
Related Questions
Which of the following operators is floor division?
+///>
Which of the following is an invalid statement?
- a=b=c=20
- a,b,c=10,20,30
- abc = 20 30 40
- abc=20
What will be the output of the following Python code?
>>> 6*3+4**2//5-8- 13
- 14
- Error
- None
What will be the output of the following Python code?
>>> a=72.55 >>> b=10 >>> c=int(a + b) >>> c- 72.55
- 72
- 82
- None of these