Python’s Modulo Operator

Photo by Karim MANJRA on Unsplash
5 % 2 is 1Two goes into five two times with a remainder of 1.
Error if using 0
Using modulo with floats
Using the Math library
Denominator determines the sign of the result
True for fmod()
Use divmod() to find quotient and remainder
Determine even or odd number
Use of modulo




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Docker GUI tool — Portainer

Using Docker for the first time

Image result for docker

Connecting Microsoft Power BI cloud service to Oracle Autonomous Database

Missing Number

Become MLOps blog Contributor

4k怪胎 完整版本 (2020-HD) I WeirDo 完整版觀看電影在線小鴨 完整的電影 4K-BLURAY

Creating Responsive Grids of Flexible Square Cards without CSS Media Queries

UniLend Finance | Project Updates #20 From the launch of the v2 OMNIS Guild Application through…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Annika Noren

Annika Noren

More from Medium

Pyplot: An introduction to the pyplot interface.

Python string replacement | string. replace() method

Cool way to print out Python keywords in Python

Data Structures in PYTHON