Find the Armstrong Number upto a number

# Compatible in Python 2.7
k=int(raw_input('Enter the range of number:'))
for n in range(k):
 sum=0
 temp=n
 y=len(str(n))
 while(n>0):
   R=n%10
   V=R**y
   sum=sum+V
   n=n/10
 if (sum==temp):
   print 'Armstrong  Number',temp

2 comments:

dpirsm said...

thats some good info

Anonymous said...

thank you.
visit
web programming tutorial
welookups