Python‎ > ‎Built-in‎ > ‎

divmod()

http://www.adilwaseem.com/

Introduction
Returns positions numbers and return divisible value and remainder.

Syntax
divmod(x)

Parameters
x=number

Examples
The return are:
 >>> divmod(1,3)
(0, 1)
>>> 
>>> divmod(3,2)
(1, 1)
>>> divmod(77,8)
(9, 5)
>>>

The methods finds the maximum and length of value of x after divmod().
 x=divmod(5,3)
>>> x
(1, 2)
>>> len(x)
2
>>> max(x)
2
>>>
Comments