From 956123d97eeba82b33c678fcb0ba9b1175dc86fb Mon Sep 17 00:00:00 2001 From: Robert Date: Mon, 25 Nov 2024 12:29:21 +0100 Subject: [PATCH] task2 done --- TaskB02/task2.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/TaskB02/task2.py b/TaskB02/task2.py index 1cd5442..8d16c27 100644 --- a/TaskB02/task2.py +++ b/TaskB02/task2.py @@ -1,7 +1,10 @@ import regex as re -with open('simple.in', encoding='utf8') as file: +with open('polish_wiki_excerpt.in', encoding='utf8') as file: lines = file.readlines() + pattern = r'( |[Pp])ies(( \w+)|$)' for line in lines: line = line.strip() - print(line) \ No newline at end of file + x = re.search(pattern, line) + if x: + print(line) \ No newline at end of file