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

Publicado em: 27 Agosto 2021
no canal de: 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!


Nesta página do site você pode assistir ao vídeo on-line Python Division and the Modulo Operator to get the Remainder - Programming Examples duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Appficial 27 Agosto 2021, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 4,174 vezes e gostou 30 espectadores. Boa visualização!