Bird
0
0

What is the output of this code?

medium📝 Predict Output Q4 of 15
Python - Standard Library Usage
What is the output of this code?
result = 7 // 3
print(result)
A3
B2.3333
C1
D2
Step-by-Step Solution
Solution:
  1. Step 1: Understand integer division

    The operator // divides and returns the integer quotient without remainder.
  2. Step 2: Calculate 7 // 3

    7 divided by 3 is 2.333..., integer division drops decimal part, so result is 2.
  3. Final Answer:

    2 -> Option D
  4. Quick Check:

    7 // 3 = 2 [OK]
Quick Trick: // drops decimals, returns integer quotient [OK]
Common Mistakes:
  • Confusing // with /
  • Expecting float result
  • Mixing up remainder with quotient

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes