aboutsummaryrefslogtreecommitdiff
path: root/challenge-085/ash/python/ch-1.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-085/ash/python/ch-1.py')
-rw-r--r--challenge-085/ash/python/ch-1.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/challenge-085/ash/python/ch-1.py b/challenge-085/ash/python/ch-1.py
new file mode 100644
index 0000000000..008c3b951d
--- /dev/null
+++ b/challenge-085/ash/python/ch-1.py
@@ -0,0 +1,16 @@
+#!/usr/bin/env python3
+#
+# Task 1 from
+# https://perlweeklychallenge.org/blog/perl-weekly-challenge-085/#TASK1
+
+from itertools import combinations
+
+r = [1.2, 0.4, 0.1, 2.5]
+# r = [0.2, 1.5, 0.9, 1.1]
+
+for row in combinations(r, 3):
+ if 1 < sum(row) < 2:
+ print(1)
+ break
+else:
+ print(0)