16 lines
455 B
Python
16 lines
455 B
Python
![]() |
import re
|
||
|
|
||
|
def pattern(file_path):
|
||
|
pattern = r'^(([a-ząćęłńóśżź][A-ZĄĆĘŁŃÓŚŻŹ])+|([A-ZĄĆĘŁŃÓŚŻŹ][a-ząćęłńóśżź])+)'
|
||
|
|
||
|
with open(file_path, 'r', encoding='utf-8') as file:
|
||
|
for line in file:
|
||
|
line = line.strip()
|
||
|
if re.match(pattern, line) and len(line) >= 2:
|
||
|
print('yes')
|
||
|
else:
|
||
|
print('no')
|
||
|
|
||
|
|
||
|
file_path = 'TaskE48/test.in'
|
||
|
pattern(file_path)
|