This article shows how to use the Python built-in divmod for unit conversions.
divmod
At codegolf.stackexchange.com, smaller is better.