This article shows how to use the Python built-in divmod for unit conversions.
divmod
There should be no such thing as boring mathematics.