import re def stars(file_path): pattern = r'^\*+$' 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 = 'TaskE07/test.in' stars(file_path)