djfz-24_25/TaskA02/solution.py
2024-10-28 16:00:27 +01:00

15 lines
413 B
Python

import sys
# return if the sentence contains word pies
def solve(lines):
return [l for l in lines if "pies" in l.lower().split(" ")]
if __name__ == "__main__":
lines = []
fp = sys.argv[1]
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)