day1/exercise/arm.py
author Christopher Burns <chris.d.burns@gmail.com>
Tue, 29 Jun 2010 00:59:26 -0500
branchscipy2010
changeset 432 13e5d0e2cd40
parent 425 5afcfce15e71
permissions -rw-r--r--
DOC: Add more slides on testing

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