djfz-2020-s444507/TaskA01/run.py
2020-11-07 20:44:11 +01:00

18 lines
273 B
Python

import sys
def is_hamlet_in_line(line):
if 'Hamlet' in line:
return True
else:
return False
file1 = open("shakespeare.res", "a")
for line in sys.stdin:
if is_hamlet_in_line(line):
file1.write(line)
print(line.rstrip('\n'))