day1/exercise/arm.py
author Puneeth Chaganti <punchagan@fossee.in>
Thu, 09 Dec 2010 23:11:12 +0530
branchscipyin2010
changeset 448 dc8d666a594a
parent 425 5afcfce15e71
permissions -rw-r--r--
Changed date format in day1/session{3,4,5}.tex.

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