Bird
0
0

What will be the output of this code?

medium📝 Predict Output Q4 of 15
Python - Operators and Expression Evaluation
What will be the output of this code?
score = 85
passed = score >= 60
print(passed)
AError
Bfalse
C85
DTrue
Step-by-Step Solution
Solution:
  1. Step 1: Evaluate the comparison

    score is 85, which is greater than or equal to 60, so 'score >= 60' is True.
  2. Step 2: Print the boolean value

    Variable 'passed' stores True, so print(passed) outputs True.
  3. Final Answer:

    True -> Option D
  4. Quick Check:

    Comparison operator result = True [OK]
Quick Trick: Comparison operators return True or False [OK]
Common Mistakes:
MISTAKES
  • Thinking it prints the number 85
  • Confusing assignment '=' with comparison '>='
  • Expecting an error due to syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes