day1/exercise/arm.py
author Madhusudan.C.S <madhusudancs@gmail.com>
Mon, 26 Oct 2009 12:41:40 +0530
changeset 166 ddfd95133adc
parent 64 333092b68926
child 425 5afcfce15e71
permissions -rw-r--r--
Taken task based approach for Session 3, day 1. Removed introduction to dictionaries slide and accommodated the same content while solving the problem.

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