Python divmod() — A Simple Guide

preview_player
Показать описание
Python’s built-in divmod(a, b) function takes two integer or float numbers a and b as input arguments and returns a tuple (a // b, a % b). The first tuple value is the result of the integer division a//b. The second tuple is the result of the remainder, also called modulo operation a % b.

►► Do you want to thrive as a self-employed Python freelancer controlling your own time, income, and work schedule?

⁉️ Do you have a question? Leave a comment and we will answer as soon as possible!

⏰ Subscribe to the channel, never miss a new video!

🐍 Did you know? Finxter is one of the top 10 Python Blogs on the internet!

🚀 More about Python & Freelancing:

#finxter #python

Do you want to thrive as a self-employed Python freelancer controlling your own time, income, and work schedule? Check out our Python freelancer resources:

Finxter Python Freelancer Course:

Finxter Python Freelancer Webinar:

Leaving the Rat Race with Python (Book):
Рекомендации по теме
Комментарии
Автор

Unfortunately it doesn't work correctly with negative numbrs as // and %. divmod(-2.1, 1) => (-3.0,

nadyuwa