Python Division and the Modulo Operator to get the Remainder - Programming Examples

Veröffentlicht am: 27 August 2021
auf dem Kanal: Appficial
4,174
30

For division use the / operator, which returns a floating-point number.
For floored division use the // operator, which rounds down the result.
Division by 0 is not allowed.

The modulo operator % get the remainder of dividing two integers. Ex: 5%2 is 1.

Modulo is useful for finding out if a number is odd or even, by simply doing number %2 and if it returns 0 it’s even, or 1 then its odd. It’s also useful for determining exact change in a vending machine, for example.

Subscribe to Appficial for more programming videos coming soon. Also, don't forget to click LIKE and comment on the video if it helped you out!


Auf dieser Seite können Sie das Online-Video Python Division and the Modulo Operator to get the Remainder - Programming Examples mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Appficial 27 August 2021 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 4,174 Mal angesehen und es wurde von 30 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!