summaryrefslogtreecommitdiff
path: root/day1/exercise/arm.py
diff options
context:
space:
mode:
Diffstat (limited to 'day1/exercise/arm.py')
-rw-r--r--day1/exercise/arm.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/day1/exercise/arm.py b/day1/exercise/arm.py
new file mode 100644
index 0000000..1234267
--- /dev/null
+++ b/day1/exercise/arm.py
@@ -0,0 +1,10 @@
+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