mirror of
https://github.com/EDeev/web-dev.git
synced 2026-06-16 21:11:00 +03:00
14 lines
306 B
Python
14 lines
306 B
Python
import re
|
||
|
||
with open('example.txt', 'r', encoding='utf-8') as f:
|
||
text = f.read()
|
||
|
||
words = re.findall(r'[а-яА-ЯёЁa-zA-Z]+', text)
|
||
max_len = max(len(w) for w in words)
|
||
result = []
|
||
for w in words:
|
||
if len(w) == max_len and w not in result:
|
||
result.append(w)
|
||
|
||
for w in result:
|
||
print(w)
|