test A01
This commit is contained in:
parent
9ed7398c52
commit
dadf179991
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
python TaskA01/run.py "$@"
|
|
@ -0,0 +1,17 @@
|
|||
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'))
|
Loading…
Reference in New Issue