Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
Python Program to Check Armstrong Number
SUBMITTED BY:
Bun
DATE:
Feb. 7, 2016, 9:50 p.m.
FORMAT:
Text only
SIZE:
303 Bytes
Raw
Download
Tweet
HITS:
1704
Go to comments
Report
#Python Program to check Armstrong Number:
number = int(input("Please enter a number: "))
sum = 0
temp = num
while temp > 0:
dgt = temp % 10
sum += dgt ** 3
temp //= 10
if num == sum:
print(num,"it is an Armstrong number")
else:
print(num,"it is not an Armstrong number")
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus