summaryrefslogtreecommitdiff
path: root/python/problems/lists_and_if-fkkt/min_and_max
diff options
context:
space:
mode:
Diffstat (limited to 'python/problems/lists_and_if-fkkt/min_and_max')
-rw-r--r--python/problems/lists_and_if-fkkt/min_and_max/common.py9
-rw-r--r--python/problems/lists_and_if-fkkt/min_and_max/sl.py2
2 files changed, 7 insertions, 4 deletions
diff --git a/python/problems/lists_and_if-fkkt/min_and_max/common.py b/python/problems/lists_and_if-fkkt/min_and_max/common.py
index 2b1d0b3..7e0da9c 100644
--- a/python/problems/lists_and_if-fkkt/min_and_max/common.py
+++ b/python/problems/lists_and_if-fkkt/min_and_max/common.py
@@ -41,12 +41,14 @@ def test(python, code, aux_code=''):
test_in = [
(None, '5\n8\n7\n'),
(None, '4\n3\n2\n'),
- (None, '1\n0\n2\n')
+ (None, '1\n0\n2\n'),
+ (None, '1\n1\n1\n')
]
test_out = [
'Minimum: 5 , Maksimum: 8',
'Minimum: 2 , Maksimum: 4',
- 'Minimum: 0 , Maksimum: 2'
+ 'Minimum: 0 , Maksimum: 2',
+ 'Minimum: 1 , Maksimum: 1'
]
# List of outputs: (expression result, stdout, stderr, exception).
@@ -56,7 +58,8 @@ def test(python, code, aux_code=''):
n_correct = 0
tin = None
for i, (output, correct) in enumerate(zip(outputs, test_out)):
- if re.sub('\s', '', output).endswith(re.sub('\s', '', correct)):
+ if re.sub('\s', '', output).endswith(re.sub('\s', '', correct)) and \
+ not re.sub('\s', '', output).endswith(re.sub('\s', '', correct)*2):
n_correct += 1
else:
tin = test_in[i][1]
diff --git a/python/problems/lists_and_if-fkkt/min_and_max/sl.py b/python/problems/lists_and_if-fkkt/min_and_max/sl.py
index 581dd5e..401f90c 100644
--- a/python/problems/lists_and_if-fkkt/min_and_max/sl.py
+++ b/python/problems/lists_and_if-fkkt/min_and_max/sl.py
@@ -7,7 +7,7 @@ slug = 'Največje in najmanjše število'
description = '''\
-<p>Izpišite največjo in najmanjšo izmed treh števil, ki jih vnese uporabnik. Ne uporabite funkcij <code>min()</code> in <code>max()</code>.<br>
+<p>Izpišite največje in najmanjše izmed treh števil, ki jih vnese uporabnik. Ne uporabite funkcij <code>min()</code> in <code>max()</code>.<br>
Primer uporabe:</p>
<pre><code><span style="color: rgb(12, 23, 255);">Vpišite 1. število:</span> <span style="color: rgb(239, 69, 64);">5</span>