branch | scipy2010 |
changeset 425 | 5afcfce15e71 |
parent 64 | 333092b68926 |
--- a/day1/exercise/arm.py Sun Jun 27 20:23:10 2010 -0500 +++ b/day1/exercise/arm.py Sun Jun 27 22:05:22 2010 -0500 @@ -3,8 +3,8 @@ 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]: + ones = i % 10 + tens = (i / 10) % 10 + hundreds = (i / 100) % 10 + if i == cubes[ones] + cubes[tens] + cubes[hundreds]: print "Armstrong Number: ", i