python - Write a program to generate all 3 digit Armstrong numbers. Email ThisBlogThis!Share to TwitterShare to Facebook Reactions: Labs 1 Comment
a=int(raw_input("number is "))
ReplyDeletet=a
s=0
while a>0:
r=a%10
s=s+r*r*r
a=a/10
print s
if (t==s):
print "armstrong"
else:
print "not armstrong"
number is 423
99
not armstrong
number is 371
371
armstrong