Bird
0
0

Find the error in this code:

medium📝 Debug Q14 of 15
Python - Conditional Statements
Find the error in this code:
score = 75
if score >= 90
    print("Excellent")
elif score >= 60:
    print("Pass")
else:
    print("Fail")
Ascore variable not defined
BWrong indentation on print statements
CUsing elif instead of else if
DMissing colon after first if condition
Step-by-Step Solution
Solution:
  1. Step 1: Check syntax of if statement

    The first if line is missing a colon : at the end, which is required in Python.
  2. Step 2: Verify other parts

    Indentation and elif usage are correct. The variable score is defined.
  3. Final Answer:

    Missing colon after first if condition -> Option D
  4. Quick Check:

    Every if needs a colon [OK]
Quick Trick: Check colons after all if/elif/else lines [OK]
Common Mistakes:
MISTAKES
  • Forgetting colon after if condition
  • Confusing elif with else if syntax
  • Incorrect indentation of print lines

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes