wykonane zadania z tasku D

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

6
TaskD03/description.txt Normal file
View File

@ -0,0 +1,6 @@
Write a program to find lines containing date from 1900 to 1999 in format '19XX r.' no matter what on the left or right of the expression.
Note that part ' r.' is obligatory.
Do use regular expressions.
POINTS: 1
DEADLINE: 2023-11-26 23:59:59

14
TaskD03/run.py Normal file
View File

@ -0,0 +1,14 @@
import re
import sys
found_lines = []
for line in sys.stdin:
if re.search(r'\b19\d{2}\s*r\.\b|\b\W19\d{2}\s*r\.\b|\b19\d{2}\s*r\.\W', line, flags=re.IGNORECASE):
found_lines.append(line.strip())
if found_lines:
print('\n'.join(found_lines), end='')

3
TaskD03/simple.exp Normal file
View File

@ -0,0 +1,3 @@
Kiedys byl 1934 r.
Kiedys byl 1934 r.fsdfsdfsdf
1934 r. to jakas data

5
TaskD03/simple.in Normal file
View File

@ -0,0 +1,5 @@
Kiedys byl 1934 r.
Kiedys byl 1934 r.fsdfsdfsdf
Kiedys byl 1935 rok
1934 r. to jakas data
1934 to tez jakas data

3
TaskD03/simple.out Normal file
View File

@ -0,0 +1,3 @@
Kiedys byl 1934 r.
Kiedys byl 1934 r.fsdfsdfsdf
1934 r. to jakas data