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 > b→5 > 3→ Trueb < 3→3 < 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
2 Likes
Related Questions
Mention any one benefit of using Kaggle for data acquisition.
Why is modelling important in AI project framework?
What will be the output of the following Python code?
str1 = 'PYTHON' print(str1[1:4])What will be the output of the following Python code?
s = "Great Day" print(s.count('a')) print(s.startswith('g'))