diff --git a/README.md b/README.md index 8da7f2b..3c26242 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Seminars +Assignment by: Lotte Felius, Kamiel Gulpen & Daan Moll Assignment for Seminars Lecture on Team-based Coding Projects Instructions: diff --git a/assignment_1.py b/assignment_1.py index 22b0d0b..ccb4dd8 100644 --- a/assignment_1.py +++ b/assignment_1.py @@ -16,7 +16,7 @@ def lower_case(string): """ ### your code starts here - + lower_string = string.lower() ### your code ends here return lower_string @@ -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 diff --git a/assignment_2a.py b/assignment_2a.py index 6395db2..3a3c2aa 100644 --- a/assignment_2a.py +++ b/assignment_2a.py @@ -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 @@ -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!") diff --git a/assignment_2b.py b/assignment_2b.py index 2a385c6..fb5c80d 100644 --- a/assignment_2b.py +++ b/assignment_2b.py @@ -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 diff --git a/assignment_2c.py b/assignment_2c.py index eaaa99a..8406aea 100644 --- a/assignment_2c.py +++ b/assignment_2c.py @@ -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