Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add files via upload #31

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Seminars
Assignment for Seminars Lecture on Team-based Coding Projects

Instructions:
1. Fork this repository.

2. Add your group member(s) as collaborators to your repo

3. Do the assignment (together):
Clone the repository to your workstation and open assigment_1.py in your favorite editor (all group members). Follow the instructions in the script.
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.

# Seminars
Assignment for Seminars Lecture on Team-based Coding Projects
Instructions:
1. Fork this repository.
2. Add your group member(s) as collaborators to your repo
3. Do the assignment (together):
Clone the repository to your workstation and open assigment_1.py in your favorite editor (all group members). Follow the instructions in the script.
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").
81 changes: 37 additions & 44 deletions assignment_1.py
Original file line number Diff line number Diff line change
@@ -1,44 +1,37 @@
"""
In this short exercise you will practice dealing with a merge conflict.
Finish the lower_case function and push your changes to the Github repository.
The fastest one to push is lucky, the others will most likely get a merge
conflict. See if you can fix it :)
"""

def lower_case(string):
"""
Argument:
string -- text you want to turn into lower case

Returns:
lower_string -- lower case version of string

"""

### your code starts here

### your code ends here

return lower_string


"""
Do the same thing again with upper_case, but change the order so everyone
experiences at least 1 merge conflict.
"""

def upper_case(string):
"""
Argument:
string -- text you want to turn into upper case

Returns:
upper_string -- upper case version of string

"""

### your code starts here

### your code ends here

return lower_string
"""
In this short exercise you will practice dealing with a merge conflict.
Finish the lower_case function and push your changes to the Github repository.
The fastest one to push is lucky, the others will most likely get a merge
conflict. See if you can fix it :)
"""

def lower_case(string):
"""
Argument:
string -- text you want to turn into lower case

Returns:
lower_string -- lower case version of string

"""
lower_string = string.upper()
return lower_string


"""
Do the same thing again with upper_case, but change the order so everyone
experiences at least 1 merge conflict.
"""

def upper_case(string):
"""
Argument:
string -- text you want to turn into upper case

Returns:
upper_string -- upper case version of string

"""

upper_string = string.lower()
return upper_string
51 changes: 26 additions & 25 deletions assignment_2a.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
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
the following numbers and strings as input for the 2 functions:
[5, 10, 100, 1000, -50, 'seminars', 'Seminars', 'CLS', 'cLs', 'Borrel']
Run the script to see if you succeeded! PS: Multiple combinations are possible,
just give a correct one.
"""

var_1 = function_2b(...)

var_2 = function_2c(...)

var_3 = str(function_2b(...)) + function_2c(...)

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

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

if var_3 == "10000cls":
print("Excellent!")
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
the following numbers and strings as input for the 2 functions:
[5, 10, 100, 1000, -50, 'seminars', 'Seminars', 'CLS', 'cLs', 'Borrel']
Run the script to see if you succeeded! PS: Multiple combinations are possible,
just give a correct one.
"""

var_1 = function_2c(1000, 100, 10, -50)["add"]

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

var_3 = str(function_2c(5, 10, 1000, -50).get('multiply')) + function_2b('CLS','').get('L')

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

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

if var_3 == "10000cls":
print("Excellent!")
print(var_1)
34 changes: 17 additions & 17 deletions assignment_2b.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
"""
Write a documentation for the simple function below. Your partner will have to
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
"""
def function_2b(string_1, string_2):

lower = string_1.lower()
upper = string_2.upper()
combined = string_1 + string_2

dict = {"L": lower,
"U": upper,
"C": combined}

return dict
"""
Write a documentation for the simple function below. Your partner will have to
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
"""
def function_2b(string_1, string_2):
lower = string_1.lower()
upper = string_2.upper()
combined = string_1 + string_2
dict = {"L": lower,
"U": upper,
"C": combined}
return dict
38 changes: 19 additions & 19 deletions assignment_2c.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
"""
Write a documentation for the simple function below. Your partner will have to
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
"""
def function_2c(w, x, y, z):

multiplication = x * y
division = x / y
addition = w + z
subtraction = w - z

results = {"multiply": multiplication,
"divide": division,
"add": addition,
"subtract": subtraction}

return results
"""
Write a documentation for the simple function below. Your partner will have to
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
"""
def function_2c(w, x, y, z):
multiplication = x * y
division = x / y
addition = w + z
subtraction = w - z
results = {"multiply": multiplication,
"divide": division,
"add": addition,
"subtract": subtraction}
return results