Browse Source

Uploading school assignment

master
Marcel Haazen 4 years ago
parent
commit
0b3aad3bfb
8 changed files with 104 additions and 5 deletions
  1. +35
    -3
      Final Assignment/FA-1.py
  2. +19
    -0
      Les 5/5-3.py
  3. +17
    -1
      Les 5/5-4.py
  4. +11
    -1
      Les 5/5-5.py
  5. BIN
      Untitled Diagram (2).png
  6. BIN
      Untitled Diagram (3).png
  7. +16
    -0
      les 6/6-2.py
  8. +6
    -0
      les 6/kaartnummers.txt

+ 35
- 3
Final Assignment/FA-1.py View File

@ -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))

+ 19
- 0
Les 5/5-3.py View File

@ -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

+ 17
- 1
Les 5/5-4.py View File

@ -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")
<<<<<<< HEAD
new_password("Hogeschool", "Utrecht1")
=======
new_password("Hogeschool","Utrecht1")
>>>>>>> Add assignments

+ 11
- 1
Les 5/5-5.py View File

@ -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])
kwadraten_som([4,5,3,-81])
=======
s = s + (number*number)
print(s)
kwadraten_som([4, 5, 3, -81 ])
>>>>>>> Add assignments

BIN
Untitled Diagram (2).png View File

Before After
Width: 373  |  Height: 364  |  Size: 20 KiB

BIN
Untitled Diagram (3).png View File

Before After
Width: 703  |  Height: 942  |  Size: 86 KiB

+ 16
- 0
les 6/6-2.py View File

@ -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])

+ 6
- 0
les 6/kaartnummers.txt View File

@ -0,0 +1,6 @@
325255, Jan Jansen
334343, Erik Materus
235434, Ali Ahson
645345, Eva Versteeg
534545, Jan de Wilde
345355, Henk de Vries

Loading…
Cancel
Save