Armstrong number in python


 

Check if a number is Armstrong or not in python

In [1]:
152  is not a armstrong number.

Armstrong number from a to b in python

In [3]:
Enter the first value of the range: 1
Enter the last value of the range: 1234567
Armstrong numbers from  1  to  1234567  are: 
1 2 3 4 5 6 7 8 9 153 370 371 407 1634 8208 9474 54748 92727 93084 548834 

No comments:

Post a Comment