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

--

--

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