jfz-2023-s464983/TaskD01/run.py
2023-12-09 21:52:30 +01:00

12 lines
317 B
Python

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