From 5e2b0ebca6ce8a534b5df8f15cc6d0df55961156 Mon Sep 17 00:00:00 2001 From: deadsmond <01.lewicki@gmail.com> Date: Tue, 3 Dec 2019 13:17:44 +0100 Subject: [PATCH] 'hm' --- TaskX04/run | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/TaskX04/run b/TaskX04/run index bb10d9d..dbed385 100644 --- a/TaskX04/run +++ b/TaskX04/run @@ -1,17 +1,8 @@ #!/usr/bin/python3 import sys import re - count = 0 - -def is_number(test): - pattern = re.compile(r'[0-9] [0-9]+ [a-z](\s\d+.\d+){0,1}') - - result = re.match(pattern, test[:-1]) - if result: - count += 1 - for line in sys.stdin: - is_number(line) - + if re.search("^\d+\s\d+\s[a-z](\s\d+\.\d+){0,1}$", line): + count+=1 print(count)