day1/exercise/arm.py
author Christopher Burns <chris.d.burns@gmail.com>
Tue, 29 Jun 2010 00:30:21 -0500
branchscipy2010
changeset 431 9126059d6b37
parent 425 5afcfce15e71
permissions -rw-r--r--
DOC: Add slide about __module__ attribute.

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