Bird
0
0

What will this code print?

medium📝 Predict Output Q5 of 15
Python - Conditional Statements
What will this code print?
score = 85
if score >= 90:
    print('A')
else:
    print('B')
AA
BNothing
CB
DError
Step-by-Step Solution
Solution:
  1. Step 1: Check the condition score >= 90

    85 is less than 90, so condition is False.
  2. Step 2: Determine which print runs

    Else block runs and prints 'B'.
  3. Final Answer:

    The output is 'B' because score is less than 90. -> Option C
  4. Quick Check:

    Condition False triggers else block [OK]
Quick Trick: If condition false, else block runs [OK]
Common Mistakes:
MISTAKES
  • Assuming 85 >= 90 is True
  • Expecting no output

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes