What is the output of the following code?
x = 10
y = 5
result = x != y and x > y
print(result)
Answer: A
The != operator is used to check if two values are not equal. In the code, x != y means 10 is not equal to 5, which is True.
The and operator returns True only if both expressions are True.
So, the expression x != y and x > y becomes True and True, which evaluates to True.
Discuss About this Question.