wykonane zadania z tasku D
This commit is contained in:
parent
2d8a843df2
commit
ee2341d218
|
@ -0,0 +1,7 @@
|
|||
Write a program to find lines containing the word "pies" separated by spaces.
|
||||
The word does not need to have space on the left if it is the line beginning or space on the right if it is line ending.
|
||||
Return line no matter of word "pies" casing.
|
||||
Do use regular expressions.
|
||||
|
||||
POINTS: 1
|
||||
DEADLINE: 2023-11-26 23:59:59
|
|
@ -0,0 +1,13 @@
|
|||
import re
|
||||
import sys
|
||||
|
||||
found_lines = []
|
||||
|
||||
for line in sys.stdin:
|
||||
if re.search(r'\b\s*pies\s*\b', line, flags=re.IGNORECASE):
|
||||
found_lines.append(line.strip())
|
||||
|
||||
|
||||
if found_lines:
|
||||
print('\n'.join(found_lines), end='')
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
Pies ma Ale
|
||||
Kot i pies to zwierzeta
|
||||
pies
|
|
@ -0,0 +1,5 @@
|
|||
Pies ma Ale
|
||||
Ala ma psa
|
||||
tu nic nie ma
|
||||
Kot i pies to zwierzeta
|
||||
pies
|
|
@ -0,0 +1,3 @@
|
|||
Pies ma Ale
|
||||
Kot i pies to zwierzeta
|
||||
pies
|
Loading…
Reference in New Issue