task c47 done

This commit is contained in:
luminoksik 2025-01-09 11:17:20 +01:00
parent cea1d6bd49
commit 4afd894364

25
TaskC47/task47.py Normal file
View File

@ -0,0 +1,25 @@
import re
pattern = re.compile(r'#[a-zA-Z]\w*')
def check(given_text):
result = re.findall(pattern, given_text)
if result:
return ';'.join(result)
else:
return '<NONE>'
### test
# with open('test.in', 'r', encoding='utf-8') as f:
# lines = f.readlines()
# for line in lines:
# line = line.strip()
# print(check(line))
while True:
text = input('Please provide your text: ')
if text == 'END':
break
print(check(text))
print('To end type END')