Advertisements
Advertisements
Question
Give the output of the following when num1 = 4, num2 = 3, num3 = 2.
print((0 < 6) or (not(10 == 6) and (10 < 0)))
Short/Brief Note
Advertisements
Solution
print( (0 < 6) or (not (10 == 6) and (10 < 0) ) )
print(True or (not False and False))
print(True or (True and False))
# not will be evaluated before and/or.
print(True or False)
print(True)
Therefore, the output will be 'True'.
shaalaa.com
Relational Operator (>,>=,<=,=,!=)
Is there an error in this question or solution?
