aboutsummaryrefslogtreecommitdiff
path: root/challenge-116/stuart-little/python/ch-2.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-116/stuart-little/python/ch-2.py')
-rwxr-xr-xchallenge-116/stuart-little/python/ch-2.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/challenge-116/stuart-little/python/ch-2.py b/challenge-116/stuart-little/python/ch-2.py
new file mode 100755
index 0000000000..3c8e5e1d45
--- /dev/null
+++ b/challenge-116/stuart-little/python/ch-2.py
@@ -0,0 +1,9 @@
+#!/usr/bin/env python
+
+# run <script> <number>
+
+import math
+import sys
+
+digSqSum=sum(map(lambda x: int(x) ** 2,list(sys.argv[1])))
+print(int(digSqSum == int(math.sqrt(digSqSum)) ** 2))