aboutsummaryrefslogtreecommitdiff
path: root/challenge-261/eric-cheung/python/ch-1.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-261/eric-cheung/python/ch-1.py')
-rwxr-xr-xchallenge-261/eric-cheung/python/ch-1.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/challenge-261/eric-cheung/python/ch-1.py b/challenge-261/eric-cheung/python/ch-1.py
new file mode 100755
index 0000000000..348279526f
--- /dev/null
+++ b/challenge-261/eric-cheung/python/ch-1.py
@@ -0,0 +1,13 @@
+
+## arrInt = [1, 2, 3, 45] ## Example 1
+## arrInt = [1, 12, 3] ## Example 2
+## arrInt = [1, 2, 3, 4] ## Example 3
+arrInt = [236, 416, 336, 350] ## Example 4
+
+arrSplit = []
+for nLoop in arrInt:
+ arrSplit = arrSplit + [int(elem) for elem in str(nLoop)]
+
+## print (sum(arrInt))
+## print (sum(arrSplit))
+print (abs(sum(arrInt) - sum(arrSplit)))