Ad

take a number as input say (n) and add all the digit of this numnber until result is not equal to a single digit no.

EX. 1245358,
output=1+2+4+5+3+5+8=28, 28=2+8=10, 10=1+0=1
so, output=1

n=int(input())
                                                                                   


for i in range(n):
    add=add+n[i]
    if add>9:
        while add<10:
            for j in range(add):
                add+=add[j]
                print(add)
    else:
        print(add)