Number Puzzles III: Armstrong Numbers¶
Use nested for
loops to find all the three-digit
Armstrong numbers. Armstrong numbers are three digit numbers such
that the sum of the digits cubed is equal to the number itself.
For example, 153
is an Armstrong number because
1³ + 5³ + 3³ = 153
.
However, 294
is not, because 2³ + 9³ + 4³ = 801
(not 294
)
Name your file number_puzzles_3.py
©2021 Daniel Gallo
This assignment is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.
Adapted for Python from Graham Mitchell’s Programming By Doing