day1/exercise/arm.py
author Santosh G. Vattam <vattam.santosh@gmail.com>
Wed, 11 Nov 2009 12:26:07 +0530
changeset 301 49bdffe4dca5
parent 64 333092b68926
child 425 5afcfce15e71
permissions -rw-r--r--
Updated session 2 slides of day 1 and added cheatsheets of day 2.

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