Bird
0
0

What will be the output of this code?

medium📝 Predict Output Q4 of 15
Python - Conditional Statements
What will be the output of this code?
score = 75
if score >= 60:
    print('Pass')
else:
    print('Fail')
AError
BPass
CFail
DNo output
Step-by-Step Solution
Solution:
  1. Step 1: Check the condition score >= 60

    Score is 75, which is greater than or equal to 60, so condition is true.
  2. Step 2: Determine which block runs

    Since condition is true, the code inside the if block runs, printing 'Pass'.
  3. Final Answer:

    Pass -> Option B
  4. Quick Check:

    Condition true prints 'Pass' [OK]
Quick Trick: True condition runs if block, prints output [OK]
Common Mistakes:
MISTAKES
  • Choosing 'Fail' because of misunderstanding condition
  • Thinking code causes error
  • Ignoring indentation rules

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes