| @ -0,0 +1,3 @@ | |||||
| { | |||||
| "python.pythonPath": "/usr/bin/python3" | |||||
| } | |||||
| @ -0,0 +1,19 @@ | |||||
| #!/usr/bin/env python3 | |||||
| #title :5-4.py | |||||
| #description :Opdracht 5.4 - Functie met if | |||||
| #author :Marcel Haazen | |||||
| #email :marcel@haazen.xyz | |||||
| #date :23-09-2019 - 11:10 | |||||
| #version :0.1 | |||||
| #usage :python3 5-4.py | |||||
| #notes : | |||||
| #python_version :3.7.4 | |||||
| #============================================================================== | |||||
| def new_password(oldpassword, newpassword): | |||||
| if (newpassword != oldpassword) and (len(newpassword) >= 6) and (any(char.isdigit() for char in newpassword) == True): | |||||
| print(True) | |||||
| else: | |||||
| print(False) | |||||
| new_password("Hogeschool", "Utrecht1") | |||||
| @ -0,0 +1,20 @@ | |||||
| #!/usr/bin/env python3 | |||||
| #title :5-5.py | |||||
| #description :Opdracht 5.5 - Functie met list-parameter en for-loop | |||||
| #author :Marcel Haazen | |||||
| #email :marcel@haazen.xyz | |||||
| #date :23-09-2019 - 11:20 | |||||
| #version :0.1 | |||||
| #usage :python3 5-5.py | |||||
| #notes : | |||||
| #python_version :3.7.4 | |||||
| #============================================================================== | |||||
| def kwadraten_som(grondgetallen): | |||||
| s = 0 | |||||
| for number in grondgetallen: | |||||
| if number > 0: | |||||
| s = s +(number*number) | |||||
| print(s) | |||||
| kwadraten_som([4,5,3,-81]) | |||||
| @ -0,0 +1,18 @@ | |||||
| #!/usr/bin/env python3 | |||||
| #title :5-6.py | |||||
| #description :Opdracht 5.6 - Functie met (im)mutable parameter | |||||
| #author :Marcel Haazen | |||||
| #email :marcel@haazen.xyz | |||||
| #date :23-09-2019 - 11:37 | |||||
| #version :0.1 | |||||
| #usage :python3 5-6.py | |||||
| #notes :Sorry ik was lam | |||||
| #python_version :3.7.4 | |||||
| #============================================================================== | |||||
| lijst = ['a', 'b', 'c'] | |||||
| def wijzig(letterlijst): | |||||
| # Overwrite letterlijst met de Output array, Works with everything :P | |||||
| letterlijst = ["d","e","f"] | |||||
| print(letterlijst) | |||||
| wijzig(lijst) | |||||
| @ -0,0 +1,22 @@ | |||||
| #!/usr/bin/env python3 | |||||
| #title :6-1.py | |||||
| #description :Opdracht 6.1 - Formatting | |||||
| #author :Marcel Haazen | |||||
| #email :marcel@haazen.xyz | |||||
| #date :23-09-2019 - 13:38 | |||||
| #version :0.1 | |||||
| #usage :python3 6-1.py | |||||
| #notes : | |||||
| #python_version :3.7.4 | |||||
| #============================================================================== | |||||
| def convert(c): | |||||
| f = 9.0/5.0 * c + 32.0 | |||||
| return f | |||||
| def table(start,stop,step): | |||||
| print('%-12s%-12s' % ("F", "C")) | |||||
| for n in range(start,stop,step): | |||||
| print('%-12.2f%-12.2f' % (convert(n), n)) | |||||
| table(-30,41,10) | |||||