Test your Python skills with multiple choice questions on if‑elif‑else statements. Practice conditional logic, syntax, and flow control with beginner-level Python MCQs.
Topic: if-elif-else
if x == 10:
The correct syntax for a simple if statement in Python uses a colon at the end, like: if condition:
x = 10
y = 5
if x == y * 2:
print("True")
else:
print("False")
True
x is 10 and y*2 is also 10, so the condition is True.
x = 3
y = 5
if x == 3 and y != 5:
print("True")
else:
print("False")
False
x == 3 is True, but y != 5 is False, so the entire condition is False.
x = 10
if 5 < x < 15:
print("x is between 5 and 15")
else:
print("x is not between 5 and 15")
x is between 5 and 15
Python supports chained comparisons. 5 < x < 15 evaluates to True.
x = 10
if x == 10
print("x is 10")
Add a colon after `if x == 10`.
Python requires a colon at the end of the if statement line.