jfz-2023-s464983/TaskE08/run.py

14 lines
315 B
Python

import re
def hihi(file_path):
pattern = r'^(hi){2,}!*$'
with open(file_path, 'r', encoding='utf-8') as file:
for line in file:
if re.match(pattern, line.strip()):
print('yes')
else:
print('no')
file_path = 'TaskE08/test.in'
hihi(file_path)