diff --git a/Final Assignment/FA-1.py b/Final Assignment/FA-1.py index d790985..c6c4b52 100644 --- a/Final Assignment/FA-1.py +++ b/Final Assignment/FA-1.py @@ -4,9 +4,10 @@ #author :Marcel Haazen #email :marcel@haazen.xyz #date :23-09-2019 - 11:53 +#edit_date :27-09-2019 - 23:25 #version :0.1 #usage :python3 FA-1.py -#notes : +#notes :Sorry als het wat gehaast is, en laat heb het snel gemaakt vanuit bed me bijholteontsteking dus wou het snel maken #python_version :3.7.4 #============================================================================== @@ -24,6 +25,37 @@ def standaardtarief(afstandKM): price = round(afstandKM * 0.8, 2) return price -ritprijs +def ritprijs(leeftijd,weekendrit,afstandKM): + basis = standaardtarief(afstandKM) + if weekendrit == True: + if leeftijd < 12 or leeftijd >= 65: + prijs = basis*0.65 + else: + prijs = basis*0.6 + else: + if leeftijd < 12 or leeftijd >= 65: + prijs = basis*0.7 + else: + prijs = basis + return round(prijs,2) + + +print(ritprijs(11,True,14)) +print(ritprijs(12,True,14)) +print(ritprijs(64,True,14)) +print(ritprijs(65,True,14)) + +print(ritprijs(11,False,14)) +print(ritprijs(12,False,14)) +print(ritprijs(64,False,14)) +print(ritprijs(65,False,14)) + +print(ritprijs(11,True,51)) +print(ritprijs(12,True,51)) +print(ritprijs(64,True,51)) +print(ritprijs(65,True,51)) -print(standaardtarief(25)) +print(ritprijs(11,False,51)) +print(ritprijs(12,False,51)) +print(ritprijs(64,False,51)) +print(ritprijs(65,False,51)) \ No newline at end of file diff --git a/Les 5/5-3.py b/Les 5/5-3.py index 2370416..fc7e4a9 100644 --- a/Les 5/5-3.py +++ b/Les 5/5-3.py @@ -1,11 +1,30 @@ #!/usr/bin/env python3 #title :5-3.py +<<<<<<< HEAD #description :Opdracht 5.3 - Functie met drie parameters #author :Marcel Haazen #email :marcel@haazen.xyz #date :21-09-2019 - 23:54 +======= +#description :Opdracht 5.3 - Functie met if +#author :Marcel Haazen +#email :marcel@haazen.xyz +#date :22-09-2019 - 13:40 +>>>>>>> Add assignments #version :0.1 #usage :python3 5-3.py #notes : #python_version :3.7.4 #============================================================================== +<<<<<<< HEAD +======= + +def lang_genoeg(length): + if length >= 120: + print("Je bent lang genoeg voor de attractie!") + else: + print("Sorry, je bent te klein!") + +lang_genoeg(119) +lang_genoeg(120) +>>>>>>> Add assignments diff --git a/Les 5/5-4.py b/Les 5/5-4.py index bae6740..fb297dd 100644 --- a/Les 5/5-4.py +++ b/Les 5/5-4.py @@ -3,6 +3,7 @@ #description :Opdracht 5.4 - Functie met if #author :Marcel Haazen #email :marcel@haazen.xyz +<<<<<<< HEAD #date :23-09-2019 - 11:10 #version :0.1 #usage :python3 5-4.py @@ -12,8 +13,23 @@ def new_password(oldpassword, newpassword): if (newpassword != oldpassword) and (len(newpassword) >= 6) and (any(char.isdigit() for char in newpassword) == True): +======= +#date :22-09-2019 - 13:50 +#version :0.1 +#usage :python3 5-4.py +#notes : Optionele opdracht ook gedaan +#python_version :3.7.4 +#============================================================================== + +def new_password(oldpassword,newpassword): + if (newpassword.lower() != oldpassword.lower()) and (len(newpassword) >= 6) and (any(char.isdigit() for char in newpassword) == True): +>>>>>>> Add assignments print(True) else: print(False) -new_password("Hogeschool", "Utrecht1") \ No newline at end of file +<<<<<<< HEAD +new_password("Hogeschool", "Utrecht1") +======= +new_password("Hogeschool","Utrecht1") +>>>>>>> Add assignments diff --git a/Les 5/5-5.py b/Les 5/5-5.py index eaf9402..760d283 100644 --- a/Les 5/5-5.py +++ b/Les 5/5-5.py @@ -3,7 +3,11 @@ #description :Opdracht 5.5 - Functie met list-parameter en for-loop #author :Marcel Haazen #email :marcel@haazen.xyz +<<<<<<< HEAD #date :23-09-2019 - 11:20 +======= +#date :22-09-2019 - 14:10 +>>>>>>> Add assignments #version :0.1 #usage :python3 5-5.py #notes : @@ -14,7 +18,13 @@ def kwadraten_som(grondgetallen): s = 0 for number in grondgetallen: if number > 0: +<<<<<<< HEAD s = s +(number*number) print(s) -kwadraten_som([4,5,3,-81]) \ No newline at end of file +kwadraten_som([4,5,3,-81]) +======= + s = s + (number*number) + print(s) +kwadraten_som([4, 5, 3, -81 ]) +>>>>>>> Add assignments diff --git a/Untitled Diagram (2).png b/Untitled Diagram (2).png new file mode 100644 index 0000000..7d667f1 Binary files /dev/null and b/Untitled Diagram (2).png differ diff --git a/Untitled Diagram (3).png b/Untitled Diagram (3).png new file mode 100644 index 0000000..772e740 Binary files /dev/null and b/Untitled Diagram (3).png differ diff --git a/les 6/6-2.py b/les 6/6-2.py new file mode 100644 index 0000000..3416e52 --- /dev/null +++ b/les 6/6-2.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 +#title :6-2.py +#description :Opdracht 6.2 - Files Lezen +#author :Marcel Haazen +#email :marcel@haazen.xyz +#date :03-10-2019 - 13:28 +#version :0.1 +#usage :python3 6-2.py +#notes : +#python_version :3.7.4 +#============================================================================== + +file = open("kaartnummers.txt", "r") +for line in file: + fields = line.split(", ") + print(fields[1] + "Heeft kaartnummer:" + fields[0]) \ No newline at end of file diff --git a/les 6/kaartnummers.txt b/les 6/kaartnummers.txt new file mode 100644 index 0000000..99021a1 --- /dev/null +++ b/les 6/kaartnummers.txt @@ -0,0 +1,6 @@ +325255, Jan Jansen +334343, Erik Materus +235434, Ali Ahson +645345, Eva Versteeg +534545, Jan de Wilde +345355, Henk de Vries \ No newline at end of file