forked from miczar1/djfz-24_25
task c47 done
This commit is contained in:
parent
cea1d6bd49
commit
4afd894364
25
TaskC47/task47.py
Normal file
25
TaskC47/task47.py
Normal 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')
|
Loading…
Reference in New Issue
Block a user