Python if / elif / else Quiz

1. What does an if statement do?
2. Which keyword means "else if"?
3. What symbol must end an if condition?
4. What will this print?
x = 5
if x > 10:
  print("A")
else:
  print("B")
5. How many else blocks can an if statement have?
6. Which comparison checks equality?
7. Which statement runs if all conditions are False?
8. What happens if indentation is wrong?
9. Which logical operator means BOTH must be true?
10. What will this print?
if True:
  print("Yes")
← Back to Lesson