Bird
0
0

What will be the output of this code?

medium📝 Predict Output Q5 of 15
Python - Operators and Expression Evaluation
What will be the output of this code?
result = 10 // 3
print(result)
A3
B3.3333
C4
DError
Step-by-Step Solution
Solution:
  1. Step 1: Understand floor division operator

    '//' divides and rounds down to the nearest whole number.
  2. Step 2: Calculate 10 // 3

    10 divided by 3 is 3.333..., floor division gives 3.
  3. Final Answer:

    3 -> Option A
  4. Quick Check:

    Floor division result = 3 [OK]
Quick Trick: Use '//' for floor division (round down) [OK]
Common Mistakes:
MISTAKES
  • Expecting float division result
  • Confusing '//' with '/'
  • Thinking it causes an error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes