Check Armstrong Number in Python

Armstrong Number in Python

In this program, you will get the example code to Check Armstrong Number in Python programming.

Armstrong number is a number which is equal to the sum of the cubes of its individual digits.

For example:-

Armstrong Number in Python formula

153 is an Armstrong number because 1^3 + 5^3 + 3^3 = 153.

 

Let’s implement the python program to check Armstrong number using if-else and while loop.

Program code for Armstrong Number in Python

Output 1

Enter a number: 153
153 is an Armstrong number

 

Output 2

Enter a number: 124
124 is not an Armstrong number

 

 

 

 

 

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top