def superDigit(n, k): n = (9 if n % 9 == 0 else n % 9) * k if len(str(n)) == 1: return n return superDigit(n,1) TypeError: not all arguments converted during st