Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
bf20d2f3a0 | |||
d9c12d5d2f | |||
35dfc38168 |
11
TaskA01/task1.py
Normal file
11
TaskA01/task1.py
Normal 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
5
TaskA02/task2.py
Normal 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
10
TaskA03/task3.py
Normal 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))
|
Loading…
Reference in New Issue
Block a user