A challange for YOU :: WRITE A PROGRAM TO FIND ALL ARMSTRONG NO. BETWEEN 0 - 999 👍 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

A challange for YOU :: WRITE A PROGRAM TO FIND ALL ARMSTRONG NO. BETWEEN 0 - 999 👍

An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to thenumber itself. For example, 371 is anArmstrong number since 3**3 + 7**3 + 1**3 = 371. Write a program to find all Armstrong number in the range of 0 and 999.

12th Nov 2017, 6:19 AM
urmomgay
4 Answers
12th Nov 2017, 7:03 AM
Zephyr Koo
Zephyr Koo - avatar
18th Nov 2017, 3:44 PM
LukArToDo
LukArToDo - avatar
+ 6
#python..... for i in range(1000): a=str(i);c=sum(int(i)**3 for i in a) if int(a)==c: print(c)
12th Nov 2017, 8:55 AM
Käzî Mrîdùl Høssäîn
Käzî Mrîdùl Høssäîn - avatar
30th Jan 2018, 3:08 AM
Orev
Orev - avatar