Python Programming - Operators - Discussion

Discussion Forum : Operators - General Questions (Q.No. 8)
8.
What is the output of the following code?
num1 = 10
num2 = 20
num3 = 30
result = num1 < num2 and num3 > num2

print(result)
True
False
None
Error
Answer: Option
Explanation:
In the code, the logical operator and is used to combine two conditions. The first condition num1 < num2 is True, and the second condition num3 > num2 is also True. So, the overall result is True.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.