Using the Python Modulo % Operator

Publié le: 11 février 2021
sur la chaîne: Real Python
22,064
278

Python supports a wide range of arithmetic operators that you can use when working with numbers in your code. One of these operators is the modulo operator (%), which returns the remainder of dividing two numbers. Modular operations are useful to check if a number is even or odd, simplifying cycling through data, and doing non-decimal based units conversion.

Python’s % operator’s been around for a long time. The code shown you has all been tested using Python 3.9, but you should be able to use it in pretty much any version of Python.

Click here to learn more: https://realpython.com/courses/python...


Sur cette page du site, vous pouvez voir la vidéo en ligne Using the Python Modulo % Operator durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Real Python 11 février 2021, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 22,064 fois et il a aimé 278 téléspectateurs. Bon visionnage!