Skip to content

Commit 79d016b

Browse files
authored
Merge pull request #2 from codezoned/master
Update
2 parents 3eaa930 + a08cf64 commit 79d016b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

general_problems/armstrong.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#by: shashank
2+
#armstrong number
3+
4+
num=int(input('Enter a Number:'))
5+
Sum=0
6+
temp=num
7+
while (temp > 0):
8+
digit=temp%10
9+
Sum+=digit**3
10+
temp//=10
11+
# print(digit,temp,Sum)
12+
13+
if (num == Sum):
14+
print('armstrong')
15+
16+
else:
17+
print('not armstrong')
18+
19+
20+

0 commit comments

Comments
 (0)