Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
332 B
1
Indexable
Never
def zadanie10(n):
    if n>0 and n<10:
        return n
    else:
        napis = str(n)
        dlugosc = len(napis)
        x = 0
        suma = 0
        while x<dlugosc:
            liczba = int(napis[x])
            suma += liczba
            x +=1
        return zadanie10(suma);


n = 555
print(zadanie10(n));