Zadanie 1 i 2
This commit is contained in:
parent
fd916dddbe
commit
07c719be98
16
.gitignore
vendored
16
.gitignore
vendored
@ -1,13 +1,3 @@
|
|||||||
*.class
|
.DS_Store
|
||||||
summary.txt
|
.idea
|
||||||
*~
|
.gitignore
|
||||||
*.out
|
|
||||||
*.far
|
|
||||||
*.res
|
|
||||||
report.txt
|
|
||||||
TaskX02/run
|
|
||||||
*.jar
|
|
||||||
*.o
|
|
||||||
*.pyc
|
|
||||||
\#*
|
|
||||||
result.csv
|
|
||||||
|
13
TaskA01/A01.py
Normal file
13
TaskA01/A01.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
def line_contain_hamlet(line):
|
||||||
|
if 'Hamlet' in line:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
for line in sys.stdin:
|
||||||
|
if line_contain_hamlet(line):
|
||||||
|
print(line.rstrip('\n'))
|
17
TaskA01/run
Normal file → Executable file
17
TaskA01/run
Normal file → Executable file
@ -1,15 +1,2 @@
|
|||||||
#!/usr/bin/python3
|
#!/bin/bash
|
||||||
|
python3 TaskA01/A01.py "$@"
|
||||||
import sys
|
|
||||||
|
|
||||||
|
|
||||||
def line_contain_hamlet(line):
|
|
||||||
if 'Hamlet' in line:
|
|
||||||
return True
|
|
||||||
else:
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
for line in sys.stdin:
|
|
||||||
if line_contain_hamlet(line):
|
|
||||||
print(line.rstrip('\n'))
|
|
20
TaskA02/A02.py
Normal file
20
TaskA02/A02.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
def contains_pies(string):
|
||||||
|
string = string.lower()
|
||||||
|
if string.startswith("pies "):
|
||||||
|
return True
|
||||||
|
elif string.endswith(" pies"):
|
||||||
|
return True
|
||||||
|
elif " pies " in string:
|
||||||
|
return True
|
||||||
|
elif string.rstrip("\n") == "pies":
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
for line in sys.stdin:
|
||||||
|
if contains_pies(line):
|
||||||
|
print(line.rstrip("\n"))
|
0
TaskA02/Makefile
Normal file
0
TaskA02/Makefile
Normal file
2
TaskA02/run
Executable file
2
TaskA02/run
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
python3 TaskA02/A02.py "$@"
|
Loading…
Reference in New Issue
Block a user