Skip to content
Open
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Seminars
Assignment by: Lotte Felius, Kamiel Gulpen & Daan Moll
Assignment for Seminars Lecture on Team-based Coding Projects

Instructions:
Expand Down
7 changes: 3 additions & 4 deletions assignment_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def lower_case(string):
"""

### your code starts here

lower_string = string.lower()
### your code ends here

return lower_string
Expand All @@ -38,7 +38,6 @@ def upper_case(string):
"""

### your code starts here

lower_string = string.upper()
### your code ends here

return lower_string
return upper_string
9 changes: 5 additions & 4 deletions assignment_2a.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from assignment_2b import function_2b
from assignment_2c import function_2c

"""
Used the imported functions (function_2b and function_2c) and the documentation
provided by your teammates to generate the correct answers below. You can use
Expand All @@ -9,17 +10,17 @@
just give a correct one.
"""

var_1 = function_2b(...)
var_2 = function_2b("Seminars", "Borrel")['C']

var_2 = function_2c(...)
var_1 = function_2c(1000, 100, 10, -50)['add']

var_3 = str(function_2b(...)) + function_2c(...)
var_3 = str(function_2c(5, 1000, 10, 10)['multiply']) + function_2b("cLs", "CLS")['L']

if var_1 == 950:
print("Good job!")

if var_2 == "SeminarsBorrel":
print("Well done!")

if var_3 == "10000cls":
print("Excellent!")
8 changes: 7 additions & 1 deletion assignment_2b.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
No cheating! Don't show or tell hem the code directly
"""
def function_2b(string_1, string_2):

"""
Takes as input 2 strings and gives as output a dictionary. The dictionary with
key "L" gives back the first string in lowercase, the dictionary with key "U"
gives back the second string in uppercase and the dictionary with key "C"
gives a third output which is a combination of both strings
of both strings
"""
lower = string_1.lower()
upper = string_2.upper()
combined = string_1 + string_2
Expand Down
21 changes: 21 additions & 0 deletions assignment_2c.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,29 @@
implement the function, without knowing the code. Send your partner the
documentation and see if he can work with it.
No cheating! Don't show or tell hem the code directly

The function_2c takes 4 parameters as input
parameters:

input(w, x, y, z)

multiply: x * y
division: x / y
addition: w + z
substraction: w - z

outputs results in form of a dict with entries named after the
"""
def function_2c(w, x, y, z):
"""
The function_2c takes 4 parameters as input(w, x, y, z). The output is a dictionary.
This dictionary contains entries: multiply, divide, add, substract.

multiply: x * y \n
divide: x / y \n
add: w + z \n
substract: w - z \n
"""

multiplication = x * y
division = x / y
Expand Down