day1/exercise/arm.py
changeset 64 333092b68926
child 425 5afcfce15e71
equal deleted inserted replaced
63:f5eac04a00fe 64:333092b68926
       
     1 cubes = []
       
     2 for i in range(10):
       
     3     cubes.append(i ** 3)
       
     4 
       
     5 for i in range(100, 1000):
       
     6     a = i % 10
       
     7     b = (i / 10) % 10
       
     8     c = (i / 100) % 10
       
     9     if i == cubes[a] + cubes[b] + cubes[c]:
       
    10         print "Armstrong Number: ", i