task2 done

This commit is contained in:
Robert 2024-11-25 12:29:21 +01:00
parent 348556373e
commit 956123d97e

View File

@ -1,7 +1,10 @@
import regex as re 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() lines = file.readlines()
pattern = r'( |[Pp])ies(( \w+)|$)'
for line in lines: for line in lines:
line = line.strip() line = line.strip()
print(line) x = re.search(pattern, line)
if x:
print(line)