forked from miczar1/djfz-24_25
task c42 done, c2 fixed
This commit is contained in:
parent
bb99e42844
commit
cea1d6bd49
@ -17,7 +17,9 @@ def check(given_text):
|
||||
# line = line.strip()
|
||||
# print(check(line))
|
||||
|
||||
flag = True
|
||||
while flag is True:
|
||||
while True:
|
||||
text = input('Please provide your text: ')
|
||||
print(check(text))
|
||||
if text == 'END':
|
||||
break
|
||||
print(check(text))
|
||||
print('To end type END')
|
25
TaskC42/task42.py
Normal file
25
TaskC42/task42.py
Normal file
@ -0,0 +1,25 @@
|
||||
import re
|
||||
|
||||
pattern = re.compile(r'^N((I[E]{6,})|([O]{6,}))[!]{3,}$')
|
||||
|
||||
def check(given_text):
|
||||
result = re.search(pattern, given_text)
|
||||
if result:
|
||||
return 'yes'
|
||||
else:
|
||||
return 'no'
|
||||
|
||||
### 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