Exam-style question
Try this first
Write the Python 3 expressions needed to calculate the real division result, integer division result and remainder when 29 is divided by 6. State the result of each expression.
Model answer
What a good answer should say
- Real division: 29 / 6 gives approximately 4.833333333333333.
- Integer division: 29 // 6 gives 4.
- Remainder: 29 % 6 gives 5.
Explanation
Why this works
The / operator gives the real or floating-point division result. The // operator gives the whole-number part of the division, while % gives the remainder.
Since 6 goes into 29 four complete times and 4 × 6 = 24, the remainder is 5.
Common mistake
No common mistake is linked to this question yet.
