Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Seminars
# Seminars (All documents have been modified in Wiki)
Assignment for Seminars Lecture on Team-based Coding Projects

Instructions:
Expand All @@ -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").
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").
6 changes: 4 additions & 2 deletions assignment_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
6 changes: 3 additions & 3 deletions assignment_2a.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!")
Expand Down
21 changes: 16 additions & 5 deletions assignment_2b.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 11 additions & 1 deletion assignment_2c.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down