KnowledgeBoat Logo
|

Robotics & Artificial Intelligence

What will be the output of the following Python code?

a = 5
b = 3
print(a > b and b < 3)

Python Funda

2 Likes

Answer

False

Working

Given: a = 5, b = 3

Evaluate the expression: a > b and b < 3

  • a > b5 > 3 → True
  • b < 33 < 3 → False

Now, True AND False → False (The AND operator returns True only when both conditions are True, otherwise, it returns False.)

Hence, the output is False.

Answered By

1 Like


Related Questions