aboutsummaryrefslogtreecommitdiff
path: root/challenge-007/zapwai/python/ch-1.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-007/zapwai/python/ch-1.py')
-rw-r--r--challenge-007/zapwai/python/ch-1.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/challenge-007/zapwai/python/ch-1.py b/challenge-007/zapwai/python/ch-1.py
new file mode 100644
index 0000000000..cf326d1c3a
--- /dev/null
+++ b/challenge-007/zapwai/python/ch-1.py
@@ -0,0 +1,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)