TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
ArmStrong Number In Python
Sr Karthiga
Aug 14
2016
Code
870
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
Arm.zip
num =
int
(input(
"Enter a number: "
))
# initialise sum
sum = 0
# find the sum of the cube of each digit
temp = num
while
temp > 0:
digit = temp % 10
sum += digit ** 3
temp
//= 10
# display the result
if
num == sum:
print(num,
"is an Armstrong number"
)
else
:
print(num,
"is not an Armstrong number"
)
Armstrong Number
python