At first glance, the Python modulo operator may not grab your attention. Yet, as youâve seen, thereâs so much to this humble operator. From checking for even numbers to encrypting text with ciphers, youâve seen many different uses for the modulo operator.
In this course, youâve learned how to:
- Use the modulo operator with
int,float,math.fmod(),divmod(), anddecimal.Decimal - Calculate the results of a modulo operation
- Solve real-world problems using the modulo operator
- Override
.__mod__()in your own classes to use them with the modulo operator
Here are additional resources about python expressions, floating point arithmetic, cryptography, and more:
