def digit_sum(n): \'\'\'(int)->number Returns the sum of all the digits in the given integer, n\'\'\' if n<10: return n return n%10 + digit
{def MDR(n): ''' this function returns multiplicative digital root. ''' count, mdr = 0, n while mdr > 9: m, digitsMul = mdr, 1 while m: m, md = divmod(m, 10) digitsMul *= md mdr = digitsMul count += 1 return count, mdr}