Compare commits

..

3 Commits

Author SHA1 Message Date
bf20d2f3a0 task3 dla simpple, brak danych dla polish_wiki 2024-10-28 13:00:28 +01:00
d9c12d5d2f task2 done 2024-10-28 12:45:42 +01:00
35dfc38168 task1 done 2024-10-28 12:35:55 +01:00
3 changed files with 26 additions and 0 deletions

11
TaskA01/task1.py Normal file
View File

@ -0,0 +1,11 @@
with open("shakespeare.in", encoding="utf8") as f:
lines = f.readlines()
for line in lines:
line = line.strip()
line = line.split()
for word in line:
if word[:6] == "Hamlet":
result = " ".join(line)
print(result)
break

5
TaskA02/task2.py Normal file
View File

@ -0,0 +1,5 @@
with open("polish_wiki_excerpt.in", encoding="utf8") as f:
lines = f.readlines()
for line in lines:
if "Pies " in line or " pies " in line or "pies\n" in line:
print(line.strip("\n"))

10
TaskA03/task3.py Normal file
View File

@ -0,0 +1,10 @@
with open("simple.in", encoding="utf-8") as f:
lines = f.readlines()
for line in lines:
line = line.strip()
line = line.split()
for i in range(len(line)-1):
if line[i][:2] == "19":
if 0 < int(line[i][3:4]) < 99:
if line[i+1][:2] == "r.":
print(" ".join(line))