Skip to content

Commit 25abd51

Browse files
Add files via upload
1 parent 880dc44 commit 25abd51

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

armstrong_bw_100_1000.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
def armstrong(n):
2+
d = str(n)
3+
l = len(d)
4+
sum_of_cube = sum(int(d) ** l for d in d)
5+
return sum_of_cube == n
6+
for n in range(100,1000):
7+
if armstrong(n):
8+
print(n)
9+
10+
11+

0 commit comments

Comments
 (0)