# Python Program to Check Armstrong Number

Here you will get python program to check armstrong number.

A number is said to be an armstrong number if sum of its digits raised to the power n is equal to itself. Here n is total digits in number.

For example 370 is armstrong number.

Here n = 3, so 33 + 7+ 0= 27 + 343 + 0 = 370

## Python Program to Check Armstrong Number

Output

enter a number: 370
armstrong number

Comment below if you have any queries related to above program for armstrong number in python.

Category: Python Programming A crazy computer and programming lover. He spend most of his time in programming, blogging and helping other programming geeks.

## 12 thoughts on “Python Program to Check Armstrong Number”

1. susmitha

can we do without length.

1. Raghav

Yes we can do it without length.

2. Afrin

What is meaning temp her?

1. Vanshika

temp is a variable which is temporarily storing the value of num

2. Chandu

It’s a temporary variable indicating as temp to store the values

3. Muskan Maheshwari

Temp is just a variable,you can also use any other variable in place of temp as i, x

3. Atanu

temp should pass more than zero or for positive integer/

4. satyam

why do we add”!” symbol after temp

1. Tarun Sura

“==” in programming this symbol means “is equal to” same way “=!” means “not equal to”
so if temp is not equal to 0 execute the below code.

1. ajith kumar

correct

5. simran

what is len in second line

1. Muskan Maheshwari

len is a function that is used for measuring the length of the number in given example