## Python Question – 2

### Armstrong Number

## Any number, say ‘n’, is called an Armstrong number if it is equal to the sum of its digits, where each is raised to the power of the number of digits in ‘n’.

For example:

Contents

153=1^{3}+5^{3}+3^{3}

**Code:**

```
num=int(input()) sum = 0
# find the sum of the cube of each digit
temp = num while temp > 0: digit = temp % 10 sum += digit ** 3 temp //= 10
# display the result
if num == sum: print("True") else: print("False")
```