Upload files to 'TaskD01'
This commit is contained in:
parent
dc2dc557d1
commit
2d8a843df2
|
@ -0,0 +1,5 @@
|
|||
Write a program to find lines containing the word "Hamlet".
|
||||
Do use regular expressions.
|
||||
|
||||
POINTS: 1
|
||||
DEADLINE: 2023-11-26 23:59:59
|
|
@ -0,0 +1,13 @@
|
|||
import re
|
||||
import sys
|
||||
|
||||
found_lines = []
|
||||
|
||||
|
||||
for line in sys.stdin:
|
||||
if re.search(r'\bHamlet\b', line):
|
||||
found_lines.append(line.strip())
|
||||
|
||||
|
||||
if found_lines:
|
||||
print('\n'.join(found_lines), end='')
|
|
@ -0,0 +1,2 @@
|
|||
Here comes Hamlet
|
||||
Hamlet Hamlet again
|
|
@ -0,0 +1,3 @@
|
|||
Here comes Hamlet
|
||||
ABC
|
||||
Hamlet Hamlet again
|
|
@ -0,0 +1,2 @@
|
|||
Here comes Hamlet
|
||||
Hamlet Hamlet again
|
Loading…
Reference in New Issue