aboutsummaryrefslogtreecommitdiff
path: root/challenge-276/zapwai/python/ch-1.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-276/zapwai/python/ch-1.py')
-rw-r--r--challenge-276/zapwai/python/ch-1.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/challenge-276/zapwai/python/ch-1.py b/challenge-276/zapwai/python/ch-1.py
new file mode 100644
index 0000000000..6b6a82a4fb
--- /dev/null
+++ b/challenge-276/zapwai/python/ch-1.py
@@ -0,0 +1,18 @@
+def proc(hours):
+ print("Input:", hours)
+ tally = 0
+ for i in range(len(hours) - 1):
+ for j in range(i + 1, len(hours)):
+ mysum = hours[i] + hours[j]
+ if mysum % 24 == 0:
+ tally += 1
+ print("Output:", tally)
+
+
+hours = [12, 12, 30, 24, 24]
+proc(hours)
+hours = [72, 48, 24, 5]
+proc(hours)
+hours = [12, 18, 24]
+proc(hours)
+