From ed65fd55357a285766144e3802a4b400cf0fee7b Mon Sep 17 00:00:00 2001 From: Robert Date: Mon, 25 Nov 2024 12:09:17 +0100 Subject: [PATCH] lab2, task 1 done, 2 started --- TaskB01/task1.py | 9 +++++++++ TaskB02/task2.py | 0 2 files changed, 9 insertions(+) create mode 100644 TaskB01/task1.py create mode 100644 TaskB02/task2.py diff --git a/TaskB01/task1.py b/TaskB01/task1.py new file mode 100644 index 0000000..e636911 --- /dev/null +++ b/TaskB01/task1.py @@ -0,0 +1,9 @@ +import regex as re + +with open('shakespeare.in', encoding='utf8') as file: + lines = file.readlines() + for line in lines: + line = line.strip() + x = re.search(r'Hamlet', line) + if x: + print(line) \ No newline at end of file diff --git a/TaskB02/task2.py b/TaskB02/task2.py new file mode 100644 index 0000000..e69de29