summaryrefslogtreecommitdiff
path: root/comp/work/21/mysum.py
diff options
context:
space:
mode:
Diffstat (limited to 'comp/work/21/mysum.py')
-rw-r--r--comp/work/21/mysum.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/comp/work/21/mysum.py b/comp/work/21/mysum.py
new file mode 100644
index 0000000..fdbb0bb
--- /dev/null
+++ b/comp/work/21/mysum.py
@@ -0,0 +1,14 @@
+nums = [[3,7,12,5],[8,4,1,6],[15,0,2,6]]
+
+def mysum(list):
+ total = 0
+ for i in list:
+ total = total + i
+ return total
+
+
+total = 0
+for i in nums:
+ total = total + mysum(i)
+
+print(total)