From b4a289c8e467d4811fb7da88ed903f9091ca15ce Mon Sep 17 00:00:00 2001 From: mbguelhan Date: Thu, 21 Oct 2021 15:53:44 +0200 Subject: [PATCH 1/4] change --- .idea/.gitignore | 3 +++ .idea/.name | 1 + .idea/Seminars.iml | 12 ++++++++++++ .idea/inspectionProfiles/profiles_settings.xml | 6 ++++++ .idea/misc.xml | 4 ++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ assignment_1.py | 8 +++++--- 8 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/.name create mode 100644 .idea/Seminars.iml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..c6e4a53 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +assignment_1.py \ No newline at end of file diff --git a/.idea/Seminars.iml b/.idea/Seminars.iml new file mode 100644 index 0000000..8a05c6e --- /dev/null +++ b/.idea/Seminars.iml @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..d1e22ec --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..3ce774c --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/assignment_1.py b/assignment_1.py index 166ef54..9fce037 100644 --- a/assignment_1.py +++ b/assignment_1.py @@ -4,7 +4,7 @@ The fastest one to push is lucky, the others will most likely get a merge conflict. See if you can fix it :) """ - +import random def lower_case(string): """ Argument: @@ -16,7 +16,8 @@ def lower_case(string): """ ### your code starts here - + lower_string = string.str.lower() + lower_string = ''.join(random.sample(lower_string, len(lower_string))) ### your code ends here return lower_string @@ -38,7 +39,8 @@ def upper_case(string): """ ### your code starts here + upper_string = string.str.upper() ### your code ends here - return lower_string + return upper_string From a709c4803c6c847b139add0d93594e89bf22e25a Mon Sep 17 00:00:00 2001 From: dversluis Date: Thu, 21 Oct 2021 16:06:39 +0200 Subject: [PATCH 2/4] Daniels commit --- assignment_1.py | 2 +- assignment_2c.py | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/assignment_1.py b/assignment_1.py index 9fce037..5437330 100644 --- a/assignment_1.py +++ b/assignment_1.py @@ -17,7 +17,7 @@ def lower_case(string): ### your code starts here lower_string = string.str.lower() - lower_string = ''.join(random.sample(lower_string, len(lower_string))) + lower_string = sorted(lower_string) ### your code ends here return lower_string diff --git a/assignment_2c.py b/assignment_2c.py index 1ac1ced..592af8e 100644 --- a/assignment_2c.py +++ b/assignment_2c.py @@ -5,6 +5,28 @@ No cheating! Don't show or tell hem the code directly """ def function_2c(w, x, y, z): + """ Performs multiplication, division, addition and subtraction on the input values. + Parameters + ---------- + w + A value to either add to z or from which z is subtracted + x + A value to either multiply by value y or which is divided by y + y + A value to either multiply by value x or divide x by + z + A value to add to w or to subtract from w + + multiplication = x * y + division = x / y + addition = w + z + subtraction = w - z + + Returns + ------- + A dictionary containing the results to the four mathematical operations on the values, with keys + "multiply", "divide", "add", "subtract". + """ multiplication = x * y division = x / y From aa2907c9ed4f5037cb2e449c8203b1923509670a Mon Sep 17 00:00:00 2001 From: mbguelhan Date: Thu, 21 Oct 2021 16:09:44 +0200 Subject: [PATCH 3/4] change --- .idea/.name | 2 +- assignment_2b.py | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.idea/.name b/.idea/.name index c6e4a53..bd675cb 100644 --- a/.idea/.name +++ b/.idea/.name @@ -1 +1 @@ -assignment_1.py \ No newline at end of file +assignment_2b.py \ No newline at end of file diff --git a/assignment_2b.py b/assignment_2b.py index 1aef416..af3dfb8 100644 --- a/assignment_2b.py +++ b/assignment_2b.py @@ -5,6 +5,20 @@ No cheating! Don't show or tell hem the code directly """ def function_2b(string_1, string_2): + """ + given parameters + string_1 : string given as first given parameter + string_2 : string given as second given parameter + + parameters made in function + lower : First string parameter in lower cases + upper: Second string parameter in upper cases + combined : A string of string_1 and string_2 combined + + returned values: + dict : is a dictionary with keys "L", "U" and "C" with values lower, upper and combined + respectively + """ lower = string_1.lower() upper = string_2.upper() @@ -13,5 +27,4 @@ def function_2b(string_1, string_2): dict = {"L": lower, "U": upper, "C": combined} - return dict From 7b7815de905b3af52288dd1a7e348aa9a43ce290 Mon Sep 17 00:00:00 2001 From: Nina Wagenaar Date: Thu, 21 Oct 2021 16:33:49 +0200 Subject: [PATCH 4/4] "Daniel, Mehmet, Nina" --- __pycache__/assignment_2b.cpython-36.pyc | Bin 0 -> 1085 bytes __pycache__/assignment_2c.cpython-36.pyc | Bin 0 -> 1322 bytes assignment_1.py | 12 +++--------- assignment_2a.py | 6 +++--- 4 files changed, 6 insertions(+), 12 deletions(-) create mode 100644 __pycache__/assignment_2b.cpython-36.pyc create mode 100644 __pycache__/assignment_2c.cpython-36.pyc diff --git a/__pycache__/assignment_2b.cpython-36.pyc b/__pycache__/assignment_2b.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8edc2715813831b1b07755e0ae779da9f8f19008 GIT binary patch literal 1085 zcmZuw&2AGh5cX~o8Wt7x#&yUAB2|e9w+Nx4R&Xi3L=_^JmAgAh-0s@J_9hD2p5QTf z0bYR@;2rkLTObaMz1a||I`ZsfJU^f38^1g}j9~SN|7bDxi|wtD^b^|Vh(yY!EDh4| zE1L#sYr^{N&wrv1T37@QsY;3*rR7#A2{Wa^E)a~!ml?vWkcqcnVW!pt_^1jEORlX% z4Qr8Qu;42Mt0M33^7!y3?wFkHLKPNnq*@C(_os&C>*loKE%U0P=gKw?dPT8RjhWuy1SOm1@VujK*h39Bd z8*emL6Q=kDjGcyQ}kq`S<8giaevxvqmZ~mN^Beury z))(Hw*#$ZG+9TlxYxKo(iF!;7`J(qlcn>0^iAYp_B_yU)=1p^BHQQ>`22W(&lMyt| zHGGY>&@ObvvjWZ7V@^e4DVH#ALP@9Dl=?KY{a zw!`_I=>szVJ{c}ljzcLVAD(Srm>IsGB*O{jWYlJ-#P5V14Y@I5F5Lr)M^}U8rh3$H zNdH|*^OyuX>IU=+!yu%uen^%Jf_xCi^lswV8$5tL(Iuy<`zlvyk>P7M^2W`7JNOHY CLrWb1 literal 0 HcmV?d00001 diff --git a/__pycache__/assignment_2c.cpython-36.pyc b/__pycache__/assignment_2c.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fc7a8ef9550ba5650461076a1d910e3ba23d71cf GIT binary patch literal 1322 zcmZ`(!EVz)5Vf5&aa|Q5ghVASLxh9^X(ELyMXjjBiK-$8gfG$7-qfqw-mtr_2>%&9ux%xtWb}j3db!Rv@KgCx*L=jrP z722Wm&GPNAGqZ->^&jt(V2T2PkOx^pQ$-ZxDJ-}E6;Y5ZS;iC=SsEDq6^(g5hR-|` zup~mIR6x$+7$R~@L2=L6YaHX=`i;;?MLbh*lk%LU*XD1)Lpp{TO+zT|0^-KrZa4%@ zB&EO>fI$T$g`A5U0}4!yy$cROL^1UA`Wc+_^o0T$@f>s(R7XdX?T!#KK?4;RUVvlAoyXRutG`dJ&0cAhohR0&r@u$mreAi;y|P#KL;HJo5#8T zHe6DH+$9o{ELLn8v%nBK!d-8fL~2Js!jKsHk* zFPnf`-i>n7D7PgzfgE1J+JLl_=>FIGW7L};AF0Yjx8K$5=ZP0_J zQ-)pNZ5{kxZC-WIxN=+5AJ%Zcvh&JbRd!L?YyZJ6eZJdr=DRIX{z2=F?D+jAJJG?j zV#M#$NyHO6!TibOytzu`9kiDPuKW5R zK0;v~xwd&6$JUSQ2z^*DhECO=&+(F&&yC_=B=yWiqso1g@Gy(%+a9i@z6!hcUt0c< A0{{R3 literal 0 HcmV?d00001 diff --git a/assignment_1.py b/assignment_1.py index 5437330..2fce717 100644 --- a/assignment_1.py +++ b/assignment_1.py @@ -4,7 +4,7 @@ The fastest one to push is lucky, the others will most likely get a merge conflict. See if you can fix it :) """ -import random + def lower_case(string): """ Argument: @@ -15,10 +15,7 @@ def lower_case(string): """ - ### your code starts here - lower_string = string.str.lower() - lower_string = sorted(lower_string) - ### your code ends here + lower_string = string.lower() return lower_string @@ -38,9 +35,6 @@ def upper_case(string): """ - ### your code starts here - upper_string = string.str.upper() - - ### your code ends here + upper_string = string.upper() return upper_string diff --git a/assignment_2a.py b/assignment_2a.py index 529aceb..d50d7e9 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, 10, -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, 10, 1000, 10)["multiply"]) + function_2b("CLS", "cLs")["L"] if var_1 == 950: print("Good job!")