python-tutorialsmade

Python program to find Armstrong number

In this Python example you are going to learn how to find a number is an Armstrong number or not. An “Armstrong number” is a number that is equal to the sum of the nth powers of its individual digits. For example, 371 is an Armstrong number where it has 3 digits and 33731= 371

Here is the Python script for finding the Armstrong number.

The above code is self explanatory, just read the comments to understand it.

Below are the Armstrong number, use these number to test this above code:

1. 153
2. 371
3. 407

And if you are looking for web based Python CGI Script to test Armstrong number, here it is:

And finally the Demo,

demo

 

Related Posts

Leave a Reply