wykonane zadania z tasku D

This commit is contained in:
Veronika Polevara 2023-11-25 16:08:02 +01:00
parent 2d8a843df2
commit ee2341d218
5 changed files with 31 additions and 0 deletions

7
TaskD02/description.txt Normal file
View 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
View 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
View File

@ -0,0 +1,3 @@
Pies ma Ale
Kot i pies to zwierzeta
pies

5
TaskD02/simple.in Normal file
View 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
View File

@ -0,0 +1,3 @@
Pies ma Ale
Kot i pies to zwierzeta
pies