jfz-2023-s473564/TaskD01/run.py

12 lines
278 B
Python
Raw Normal View History

2023-11-27 14:34:07 +01:00
import re
def find_hamlet_lines(file_path):
with open(file_path, 'r') as file:
for line in file:
line = line.strip()
if re.search(r'\bHamlet\b', line):
print(f"{line}")
file_path = './simple.in'
find_hamlet_lines(file_path)