wykonane zadania z tasku D
This commit is contained in:
parent
2d8a843df2
commit
ee2341d218
7
TaskD02/description.txt
Normal file
7
TaskD02/description.txt
Normal file
@ -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
|
13
TaskD02/run.py
Normal file
13
TaskD02/run.py
Normal file
@ -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='')
|
||||
|
3
TaskD02/simple.exp
Normal file
3
TaskD02/simple.exp
Normal file
@ -0,0 +1,3 @@
|
||||
Pies ma Ale
|
||||
Kot i pies to zwierzeta
|
||||
pies
|
5
TaskD02/simple.in
Normal file
5
TaskD02/simple.in
Normal file
@ -0,0 +1,5 @@
|
||||
Pies ma Ale
|
||||
Ala ma psa
|
||||
tu nic nie ma
|
||||
Kot i pies to zwierzeta
|
||||
pies
|
3
TaskD02/simple.out
Normal file
3
TaskD02/simple.out
Normal file
@ -0,0 +1,3 @@
|
||||
Pies ma Ale
|
||||
Kot i pies to zwierzeta
|
||||
pies
|
Loading…
Reference in New Issue
Block a user