fork(1) download
  1. # your code goes here
  2. # your code goes here
  3. def is_armstrong(number: int) -> bool:
  4. number_list = [int(n) for n in str(number)]
  5. number_list_power =[n ** len(str(number)) for n in number_list]
  6. return (sum(number_list_power) == number)
  7.  
  8. for n in range (100, 10000):
  9. if is_armstrong(n):
  10. print (n)
Success #stdin #stdout 0.06s 9204KB
stdin
Standard input is empty
stdout
153
370
371
407
1634
8208
9474