Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Max Digit by mennadiego
def max_digit(value: int) -> int:
"""
You have a number and you need to determine which digit in this number is the biggest.
:param value: input value
:return: max value in digits
"""
# Converting value to string
return max([int(x) for x in str(value)])
print("Example:")
print(max_digit(10))
# These "asserts" are used for self-checking
assert max_digit(0) == 0
assert max_digit(52) == 5
assert max_digit(634) == 6
assert max_digit(1) == 1
assert max_digit(10000) == 1
print("The mission is done! Click 'Check Solution' to earn rewards!")
Aug. 5, 2023