The biggest value the expression "number%19" can evaluate to is 18.
From the theory of division with remainder:
D = I * C + R, where R < I and D, I, C, R are natural numbers.
In our case:
- D = number
- I = 19
- C = number/19 (or number//19 if we are talking about Python 3)
- R = number%19
We can note that R < I, so R < 19. So what is the biggest natural number smaller than 19? Well, most kindergartners will respond 18.
► General rule regarding the % operation:
We can easily prove that a % b will be: