From 35dfc38168a16294fc6e18c47e46d862d13a53b3 Mon Sep 17 00:00:00 2001 From: Robert Date: Mon, 28 Oct 2024 12:35:55 +0100 Subject: [PATCH] task1 done --- TaskA01/task1.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 TaskA01/task1.py diff --git a/TaskA01/task1.py b/TaskA01/task1.py new file mode 100644 index 0000000..59cf72b --- /dev/null +++ b/TaskA01/task1.py @@ -0,0 +1,11 @@ +with open("shakespeare.in", encoding="utf8") as f: + lines = f.readlines() + for line in lines: + line = line.strip() + line = line.split() + for word in line: + if word[:6] == "Hamlet": + result = " ".join(line) + print(result) + break +