jfz-2023-s464983/TaskD01/run.py

10 lines
260 B
Python

import re
def hamlet_reg(file_path):
with open(file_path, 'r', encoding='utf-8') as file:
for line in file:
if (re.search("'.*Hamlet.*", line)):
print(line.strip())
file_path = 'TaskD01\simple.in'
hamlet_reg(file_path)