Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
base = 10 or not ; divmod to find digits ; stop if encounter the maximal digit solution in Speedy category for Max Digit by Phil15
def max_digit(number, base=10):
result = 0
# Second test allows to stop iterate on digits if unneccesary. Example:
# 10000000000000000000000009, result=9 immediately, no need to continue.
while number and result != base - 1:
number, digit = divmod(number, base)
result = max(result, digit)
return result
March 2, 2020