From a7892ad18536e8cab40bb1aad98f1d49c009353a Mon Sep 17 00:00:00 2001 From: Robert Date: Mon, 25 Nov 2024 12:42:37 +0100 Subject: [PATCH] task 4 done to check --- TaskB04/task4.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 TaskB04/task4.py diff --git a/TaskB04/task4.py b/TaskB04/task4.py new file mode 100644 index 0000000..f115482 --- /dev/null +++ b/TaskB04/task4.py @@ -0,0 +1,10 @@ +import re + +with open('polish_wiki_excerpt.in', encoding='utf8') as file: + lines = file.readlines() + pattern = r'\d+' + for line in lines: + line = line.strip() + x = re.findall(pattern, line) + if x: + print(' '.join(x)) \ No newline at end of file