Bird
0
0

What will be the output of this code?

medium📝 Predict Output Q13 of 15
Python - Conditional Statements

What will be the output of this code?

score = 75
if score >= 90:
    print("A")
elif score >= 80:
    print("B")
elif score >= 70:
    print("C")
else:
    print("F")
AA
BB
CF
DC
Step-by-Step Solution
Solution:
  1. Step 1: Check conditions in order with score=75

    score >= 90? No. score >= 80? No. score >= 70? Yes.
  2. Step 2: Print output for first true condition

    Prints "C" and stops checking further.
  3. Final Answer:

    C -> Option D
  4. Quick Check:

    75 >= 70 = True, prints C [OK]
Quick Trick: Check conditions top to bottom, stop at first true [OK]
Common Mistakes:
MISTAKES
  • Choosing B or A ignoring order
  • Thinking else runs when elif true
  • Confusing >= with >

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes