aboutsummaryrefslogtreecommitdiff
path: root/challenge-007/zapwai/python/ch-1.py
blob: cf326d1c3a38fcc81f4c8e5b29c3ff8cafaef14c (plain)
1
2
3
4
5
6
7
8
9
def niven(n):
    for i in range(1, n+1):
        tally = 0
        digit = list(str(i))
        for j in range(len(digit)):
            tally += int(digit[j])
        if i % tally == 0:
            print(i)
niven(51)