Bird
0
0

What is the output of this Python code?

medium📝 Predict Output Q13 of 15
Python - Standard Library Usage
What is the output of this Python code?
result = 10 % 3
print(result)
A1
B3
C0
D10
Step-by-Step Solution
Solution:
  1. Step 1: Calculate 10 modulo 3

    10 divided by 3 is 3 with remainder 1, so 10 % 3 equals 1.
  2. Step 2: Understand print output

    The print statement outputs the value stored in result, which is 1.
  3. Final Answer:

    1 -> Option A
  4. Quick Check:

    10 % 3 = 1 [OK]
Quick Trick: Modulo gives remainder after division [OK]
Common Mistakes:
  • Confusing modulo with division
  • Expecting quotient instead of remainder
  • Misreading print output

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes