Advertisements
Advertisements
Question
Give the output of the following when num1 = 4, num2 = 3, num3 = 2.
print(5 % 10 + 10 < 50 and 29 <= 29)
Short/Brief Note
Advertisements
Solution
print(5 % 10 + 10 < 50 and 29 <= 29)
Taking the above statement in two separate parts
LHS :
5 % 10 + 10 < 50
5 + 10 < 50
15 < 50
True
RHS:
29 <= 29
True
Now, the complete equation can be written as
print(True and True)
Therefore, the output will be 'True'.
shaalaa.com
Operators - Arithmetic Operators (-,+,*,/,%)
Is there an error in this question or solution?
