Compute quotient and remainder using the divmod() function.
The divmod() function takes two (non-complex) numbers as arguments and returns a pair of numbers consisting of their quotient and remainder when using integer division.
For integers, the result is the same as (a // b, a % b).
- https://docs.python.org/3/library/functions.html#divmod
- https://forum.freecodecamp.com/t/python-function-divmod/75415
- https://docs.python.org/3.6/reference/expressions.html#index-59
- https://docs.python.org/3/library/stdtypes.html#numeric-types-int-float-complex
>>> divmod(1, 1)
(1, 0)
>>> divmod(3, 2)
(1, 1)
>>> divmod(3.0, 2)
(1.0, 1.0)
Instructions:
In this exercise, variables a and b are defined for you.
Define a variable named result that calls the divmod() function on variables a and b (in that order).