avatar Bite 279. Armstrong numbers

In number theory there are many interesting numbers - eg. Armstrong numbers, Happy numbers, Meertens numbers, just name a few.

In this bite, you will try to solve the Armstrong number question: given an integer, determine if it is an armstrong number.

An armstrong number is a number that is the sum of its own digits each raised to the power of the number of digits. See this reference for more info and here are some examples:

a) 153 is an armstrong number. It's a 3 digits number:

    (1^3) + (5^3) + (3^3)= 153.

b) 371 is also an armstrong number.

c) any single digit numbers (1-9) are armstrong numbers as well.

Login and get coding
go back Beginner level
Bitecoin 2X

141 out of 141 users completed this Bite.
Will you be Pythonista #142 to crack this Bite?
Resolution time: ~20 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 1.33 on a 1-10 difficulty scale.
» You can do it! 😌

We use Python 3.8