From b428fda1b00d31a38e14de6317de62c41d990c85 Mon Sep 17 00:00:00 2001 From: Stanislav Lytvynenko Date: Mon, 3 Feb 2025 00:47:07 +0100 Subject: [PATCH] Upload files to "TaskB01" --- TaskB01/run.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 TaskB01/run.py diff --git a/TaskB01/run.py b/TaskB01/run.py new file mode 100644 index 0000000..7553610 --- /dev/null +++ b/TaskB01/run.py @@ -0,0 +1,11 @@ +input_file = 'shakespeare.exp' + + +with open(input_file, 'r', encoding='utf-8') as file: + lines = file.readlines() + + +for i, line in enumerate(lines, start=1): + if 'Hamlet' in line or 'hamlet' in line: + print(f"{i}: {line.strip()}") +