Python Programming - Conditional Statements - Discussion
Discussion Forum : Conditional Statements - General Questions (Q.No. 3)
3.
What will be the output of the following code?
x = 10
y = 5
if x > y:
print("x is greater")
else:
print("y is greater")
Answer: Option
Explanation:
The code compares the values of
x
and y
using the >
(greater than) operator. Since x
is greater than y
, the code inside the if
block will be executed, printing "x is greater."
Discussion:
Be the first person to comment on this question !
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers