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

17 lines
272 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'))