forked from miczar1/djfz-24_25
Complete task 3
This commit is contained in:
parent
5dbcfb00b3
commit
5417f67adf
951
TaskB03/polish_wiki_excerpt.out
Normal file
951
TaskB03/polish_wiki_excerpt.out
Normal file
File diff suppressed because one or more lines are too long
19
TaskB03/solution.py
Normal file
19
TaskB03/solution.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import sys
|
||||||
|
import re
|
||||||
|
|
||||||
|
def solve(lines):
|
||||||
|
print(len(lines))
|
||||||
|
return [l for l in lines if re.search(r"19\d\d r\.", l)]
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
lines = []
|
||||||
|
|
||||||
|
fp = sys.argv[1]
|
||||||
|
assert("polish_wiki_excerpt" in fp)
|
||||||
|
|
||||||
|
print(fp)
|
||||||
|
with open(fp, encoding="utf-8") as f:
|
||||||
|
lines = f.readlines()
|
||||||
|
sol = solve(lines)
|
||||||
|
with open("./polish_wiki_excerpt.out", 'w', encoding="utf-8") as f:
|
||||||
|
f.writelines(sol)
|
Loading…
Reference in New Issue
Block a user