e od 0 do 7
This commit is contained in:
parent
9e915b26ba
commit
b1e6a2a7f8
@ -1,7 +1,7 @@
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
def check_number_divisible_by_5(input_string):
|
def check_number_divisible_by_5(input_string):
|
||||||
pattern = r'^[1-9]*(0|5)$'
|
pattern = r'^(5|0|[1-9][0-9]*[05])$'
|
||||||
|
|
||||||
if re.match(pattern, input_string):
|
if re.match(pattern, input_string):
|
||||||
print('yes')
|
print('yes')
|
||||||
|
18
TaskE01/run.py
Normal file
18
TaskE01/run.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import re
|
||||||
|
|
||||||
|
def check_number_divisible_by_5(input_string):
|
||||||
|
pattern = r'^(0|25|50|75|[1-9][0-9]*(25|00|50|75))$'
|
||||||
|
|
||||||
|
if re.match(pattern, input_string):
|
||||||
|
print('yes')
|
||||||
|
else:
|
||||||
|
print('no')
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
try:
|
||||||
|
while True:
|
||||||
|
line = input()
|
||||||
|
check_number_divisible_by_5(line)
|
||||||
|
|
||||||
|
except EOFError:
|
||||||
|
pass
|
0
TaskE02/run.py
Normal file
0
TaskE02/run.py
Normal file
18
TaskE03/run.py
Normal file
18
TaskE03/run.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import re
|
||||||
|
|
||||||
|
def check_number_divisible_by_5(input_string):
|
||||||
|
pattern = r'^(\d{3}-\d{3}-\d{2}-\d{2}|\d{3}\d{2}-\d{2}-\d{3})$'
|
||||||
|
|
||||||
|
if re.match(pattern, input_string):
|
||||||
|
print('yes')
|
||||||
|
else:
|
||||||
|
print('no')
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
try:
|
||||||
|
while True:
|
||||||
|
line = input()
|
||||||
|
check_number_divisible_by_5(line)
|
||||||
|
|
||||||
|
except EOFError:
|
||||||
|
pass
|
18
TaskE04/run.py
Normal file
18
TaskE04/run.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import re
|
||||||
|
|
||||||
|
def check_number_divisible_by_5(input_string):
|
||||||
|
pattern = r'^555(-\d{3}-\d{3}| \d{3} \d{3})$'
|
||||||
|
|
||||||
|
if re.match(pattern, input_string):
|
||||||
|
print('yes')
|
||||||
|
else:
|
||||||
|
print('no')
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
try:
|
||||||
|
while True:
|
||||||
|
line = input()
|
||||||
|
check_number_divisible_by_5(line)
|
||||||
|
|
||||||
|
except EOFError:
|
||||||
|
pass
|
18
TaskE05/run.py
Normal file
18
TaskE05/run.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import re
|
||||||
|
|
||||||
|
def check_number_divisible_by_5(input_string):
|
||||||
|
pattern = r'^(PCMCIA|WYSIWYG|[A-Z]{2,5})$'
|
||||||
|
|
||||||
|
if re.match(pattern, input_string):
|
||||||
|
print('yes')
|
||||||
|
else:
|
||||||
|
print('no')
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
try:
|
||||||
|
while True:
|
||||||
|
line = input()
|
||||||
|
check_number_divisible_by_5(line)
|
||||||
|
|
||||||
|
except EOFError:
|
||||||
|
pass
|
18
TaskE06/run.py
Normal file
18
TaskE06/run.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import re
|
||||||
|
|
||||||
|
def check_number_divisible_by_5(input_string):
|
||||||
|
pattern = r'^[1-9]\d{4,5}$'
|
||||||
|
|
||||||
|
if re.match(pattern, input_string):
|
||||||
|
print('yes')
|
||||||
|
else:
|
||||||
|
print('no')
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
try:
|
||||||
|
while True:
|
||||||
|
line = input()
|
||||||
|
check_number_divisible_by_5(line)
|
||||||
|
|
||||||
|
except EOFError:
|
||||||
|
pass
|
18
TaskE07/run.py
Normal file
18
TaskE07/run.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import re
|
||||||
|
|
||||||
|
def check_number_divisible_by_5(input_string):
|
||||||
|
pattern = r'^\*+$'
|
||||||
|
|
||||||
|
if re.match(pattern, input_string):
|
||||||
|
print('yes')
|
||||||
|
else:
|
||||||
|
print('no')
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
try:
|
||||||
|
while True:
|
||||||
|
line = input()
|
||||||
|
check_number_divisible_by_5(line)
|
||||||
|
|
||||||
|
except EOFError:
|
||||||
|
pass
|
Loading…
Reference in New Issue
Block a user