From 8aae5fe21bef3bf33187f819055a5756491960c0 Mon Sep 17 00:00:00 2001 From: Marcel Haazen Date: Mon, 23 Sep 2019 14:34:00 +0200 Subject: [PATCH] Uploaded assignemtns --- .vscode/settings.json | 3 +++ Les 5/5-4.py | 19 +++++++++++++++++++ Les 5/5-5.py | 20 ++++++++++++++++++++ Les 5/5-6.py | 18 ++++++++++++++++++ les 6/6-1.py | 22 ++++++++++++++++++++++ 5 files changed, 82 insertions(+) create mode 100644 .vscode/settings.json create mode 100644 Les 5/5-4.py create mode 100644 Les 5/5-5.py create mode 100644 Les 5/5-6.py create mode 100644 les 6/6-1.py diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..615aafb --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.pythonPath": "/usr/bin/python3" +} \ No newline at end of file diff --git a/Les 5/5-4.py b/Les 5/5-4.py new file mode 100644 index 0000000..bae6740 --- /dev/null +++ b/Les 5/5-4.py @@ -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") \ No newline at end of file diff --git a/Les 5/5-5.py b/Les 5/5-5.py new file mode 100644 index 0000000..eaf9402 --- /dev/null +++ b/Les 5/5-5.py @@ -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]) \ No newline at end of file diff --git a/Les 5/5-6.py b/Les 5/5-6.py new file mode 100644 index 0000000..978f0d2 --- /dev/null +++ b/Les 5/5-6.py @@ -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) \ No newline at end of file diff --git a/les 6/6-1.py b/les 6/6-1.py new file mode 100644 index 0000000..61203ed --- /dev/null +++ b/les 6/6-1.py @@ -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) \ No newline at end of file