If Elif Else
Predict Output Easy
Question
What does this code print?
Code
x = 10
if x > 15:
print("big")
elif x > 5:
print("medium")
else:
print("small")
Hint
x is 10, which is > 5 but not > 15.
Explanation
x is 10. x > 15 is false. x > 5 is true, so "medium" is printed. The else is skipped. Output: medium.
Related Resources
Related Lessons
- Conditions & Loops
Learn conditions and loops.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.