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
Binary file added .DS_Store
Binary file not shown.
Binary file added __pycache__/assignment_2b.cpython-39.pyc
Binary file not shown.
Binary file added __pycache__/assignment_2c.cpython-39.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions assignment_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def lower_case(string):
"""

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

### your code ends here

Expand Down
8 changes: 5 additions & 3 deletions assignment_2a.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
Run the script to see if you succeeded! PS: Multiple combinations are possible,
just give a correct one.
"""
help(function_2b)
help(function_2c)

var_1 = function_2b(...)
var_1 = function_2c(1000, 5, -5, 50)['subtract']

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

var_3 = str(function_2b(...)) + function_2c(...)
var_3 = str(function_2c(5, 10, 1000, 5)['multiply']) + function_2b('CLs', 'borrel')['L']

if var_1 == 950:
print("Good job!")
Expand Down
2 changes: 1 addition & 1 deletion assignment_2b.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
No cheating! Don't show or tell hem the code directly
"""
def function_2b(string_1, string_2):

''' the function results in the first string in lower case, the second strong in upper case and then both of them combined. '''
lower = string_1.lower()
upper = string_2.upper()
combined = string_1 + string_2
Expand Down
2 changes: 1 addition & 1 deletion assignment_2c.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
No cheating! Don't show or tell hem the code directly
"""
def function_2c(w, x, y, z):

'''this function multiplies the 2nd and 3rd input, divides the 2nd and 3rd input, adds the 1st and 4th input, and subtracts the 4th from the 1st input '''
multiplication = x * y
division = x / y
addition = w + z
Expand Down