Bird
0
0

What is the output of this code?

medium📝 Predict Output Q4 of 15
Python - Operators and Expression Evaluation
What is the output of this code?
print(7 <= 7)
AFalse
BTrue
C7
DError
Step-by-Step Solution
Solution:
  1. Step 1: Understand the operator '<='

    '<=' means 'less than or equal to'. Here, 7 is compared to 7.
  2. Step 2: Evaluate the expression 7 <= 7

    Since 7 is equal to 7, the expression is True.
  3. Final Answer:

    True -> Option B
  4. Quick Check:

    7 <= 7 is True [OK]
Quick Trick: Use '<=' to include equality in comparison [OK]
Common Mistakes:
MISTAKES
  • Thinking 7 <= 7 is False
  • Confusing with '<' only
  • Expecting numeric output instead of boolean

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes