Skip to content

Commit ad3c3fa

Browse files
author
codehouseindia
authored
Merge pull request codehouseindia#351 from Shaivyaa/patch-1
added the armstrong program
2 parents bf25001 + 97d8926 commit ad3c3fa

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

armstrong22.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# https://www.facebook.com/100012984916915/posts/1035265666916254/
2+
# Subscribed By Code House
3+
num = int(input("Enter a number: "))
4+
5+
sum=0
6+
7+
temp = num
8+
while temp>0:
9+
digit = temp % 10
10+
sum += digit ** 3
11+
temp //=10
12+
13+
if num == sum:
14+
print(num,"is an armstrong number")
15+
else:
16+
print(num,"is not an armstrong number")

0 commit comments

Comments
 (0)