Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
4-liner: sum it up solution in Creative category for Sum of Digits by Stensen
summation = lambda n: sum(map(int, str(n)))
def sum_digits(num: int) -> int:
while len(str(num)) != 1: num = summation(num)
return num
Sept. 29, 2022
Comments: