day1/exercise/arm.py
author Prabhu Ramachandran <prabhu@aero.iitb.ac.in>
Mon, 14 Jun 2010 20:16:05 -0400
branchscipy2010
changeset 399 7775af81b51a
parent 64 333092b68926
child 425 5afcfce15e71
permissions -rw-r--r--
Initial checkin of file with details of the plan for the tutorial.

cubes = []
for i in range(10):
    cubes.append(i ** 3)

for i in range(100, 1000):
    a = i % 10
    b = (i / 10) % 10
    c = (i / 100) % 10
    if i == cubes[a] + cubes[b] + cubes[c]:
        print "Armstrong Number: ", i