aboutsummaryrefslogtreecommitdiff
path: root/python/RecursiveDigitSum.py
blob: 98a808d79ec20b3d58d8828aefc8be122e563c20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/env/python3
x,n = map(int, input().split())
x = str(x)
x = x * n 
print(x)
def recursive_digit_sum(x):
    y = 0
    if len(x) == 1:
        return x;
    else:
        for i in x:
            y += int(i)
        print("y: ", y)
        return recursive_digit_sum(str(y))
print(recursive_digit_sum(x))