KnowledgeBoat Logo
|

Informatics Practices

Give the output of the following:

print(5 % 10 + 10 < 50 and 29 <= 29)

Python Control Flow

1 Like

Answer

True

Working

In the expression 5 % 10 + 10 < 50 and 29 <= 29, according to operator precedence, 5 % 10 calculates to 5, then 5 + 10 equals 15. Next, 15 < 50 evaluates to True. Separately, 29 <= 29 also evaluates to True. The and operator then combines these results. Since both conditions are True, the and operator yields True, which is printed.

Answered By

1 Like


Related Questions