Zadanie 1 i 2

This commit is contained in:
s450026 2020-11-08 15:49:37 +01:00
parent fd916dddbe
commit 07c719be98
6 changed files with 40 additions and 28 deletions

16
.gitignore vendored
View File

@ -1,13 +1,3 @@
*.class
summary.txt
*~
*.out
*.far
*.res
report.txt
TaskX02/run
*.jar
*.o
*.pyc
\#*
result.csv
.DS_Store
.idea
.gitignore

13
TaskA01/A01.py Normal file
View 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
View File

@ -1,15 +1,2 @@
#!/usr/bin/python3
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'))
#!/bin/bash
python3 TaskA01/A01.py "$@"

20
TaskA02/A02.py Normal file
View 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
View File

2
TaskA02/run Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
python3 TaskA02/A02.py "$@"