14 lines
315 B
Python
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) |