diff --git a/README.md b/README.md index cefc94b..d3805a6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Seminars +# Seminars (All documents have been modified in Wiki) Assignment for Seminars Lecture on Team-based Coding Projects Instructions: @@ -11,4 +11,4 @@ Clone the repository to your workstation and open assigment_1.py in your favorit When you are finished, you split up for assignment 2. One of you opens 2a, the other two do 2b and 2c (if you are a group of two, the same person does 2b and 2c). Everyone follows the instructions in their script. Once you have pushed all your changes, continue. -4. Create a pull request for me to this (original) repo. (Hint: you can use the "New pull request" button and then do a "compare across forks"). \ No newline at end of file +4. Create a pull request for me to this (original) repo. (Hint: you can use the "New pull request" button and then do a "compare across forks"). diff --git a/assignment_1.py b/assignment_1.py index 166ef54..c623b6c 100644 --- a/assignment_1.py +++ b/assignment_1.py @@ -16,7 +16,8 @@ def lower_case(string): """ ### your code starts here - + lower_string = string + lower_string = lower_string.lower() ### your code ends here return lower_string @@ -38,7 +39,8 @@ def upper_case(string): """ ### your code starts here - + lower_string = string + lower_string = lower_string.upper() ### your code ends here return lower_string diff --git a/assignment_2a.py b/assignment_2a.py index 529aceb..4ab4786 100644 --- a/assignment_2a.py +++ b/assignment_2a.py @@ -9,11 +9,11 @@ just give a correct one. """ -var_1 = function_2b(...) +var_1 = function_2c(1000,5,5,-50)["add"] -var_2 = function_2c(...) +var_2 = function_2b('Seminars','Borrel')["C"] -var_3 = str(function_2b(...)) + function_2c(...) +var_3 = str(function_2c(5,1000,10,5)['multiply']) + function_2b('CLS','CLS')["L"] if var_1 == 950: print("Good job!") diff --git a/assignment_2b.py b/assignment_2b.py index 1aef416..2435ac0 100644 --- a/assignment_2b.py +++ b/assignment_2b.py @@ -5,13 +5,24 @@ No cheating! Don't show or tell hem the code directly """ def function_2b(string_1, string_2): - + """Transform string_1 to upper case, string 2 to lower_case, + and combine both into a single string + + Args: + string_1 (str): String to transform to upper case + string_2 (str): String to transform to lower case + + Returns: + dict: Dict containing upper, lower, and concatened strs + """ lower = string_1.lower() upper = string_2.upper() combined = string_1 + string_2 - - dict = {"L": lower, - "U": upper, - "C": combined} + + dict = { + "L": lower, + "U": upper, + "C": combined + } return dict diff --git a/assignment_2c.py b/assignment_2c.py index 1ac1ced..b45a9e4 100644 --- a/assignment_2c.py +++ b/assignment_2c.py @@ -5,7 +5,17 @@ No cheating! Don't show or tell hem the code directly """ def function_2c(w, x, y, z): - + """Compute various arithmetic operations on input + + Args: + w (float): Input number + x (float): Input number + y (float): Input number + z (float): Input number + + Returns: + dict: Dictionary containing x * y, x / y, w + z, w -z + """ multiplication = x * y division = x / y addition = w + z