Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
The print function
Variables
Math in Python
16. Modulo operation
The input function
Summary

Instruction

Great! One more mathematical operator that is quite common in programming is the modulo operator, the new variable to a percentage sign (%). In modulo arithmetic, a%b will return the remainder of the division of a by b. For instance, 8%2 will return 0 because 8 divided by 2 is 4 with no remainder.

print(13%3)

The code above will print 1 because 3 * 4 + 1 = 13.

Exercise

Print the remainder of the division of 155 by 15.

Stuck? Here's a hint!

Follow the example in the explanation.