day1/exercise/arm.py
author Christopher Burns <chris.d.burns@gmail.com>
Sun, 27 Jun 2010 22:05:22 -0500
branchscipy2010
changeset 425 5afcfce15e71
parent 64 333092b68926
permissions -rw-r--r--
REF: Reformat some of the exercises so they're easier to read for the audience.

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

for i in range(100, 1000):
    ones = i % 10
    tens = (i / 10) % 10
    hundreds = (i / 100) % 10
    if i == cubes[ones] + cubes[tens] + cubes[hundreds]:
        print "Armstrong Number: ", i