From c871e9b7811f399914672cce32432e6265532724 Mon Sep 17 00:00:00 2001 From: Marcel Haazen Date: Fri, 13 Sep 2019 09:11:42 +0200 Subject: [PATCH] Python stuffs --- .vscode/launch.json | 70 ++++++++++++++++++++++++++ .vscode/tasks.json | 12 +++++ __pycache__/opdr3.cpython-37.pyc | Bin 0 -> 296 bytes __pycache__/statements.cpython-37.pyc | Bin 0 -> 301 bytes les1/Expressions.py | 6 +++ les1/opdr2.py | 9 ++++ les1/opdr3.py | 8 +++ les1/opdr4.py | 14 ++++++ les2/opdr1.py | 6 +++ les2/opdr2.py | 5 ++ les2/opdr3.py | 4 ++ 11 files changed, 134 insertions(+) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json create mode 100644 __pycache__/opdr3.cpython-37.pyc create mode 100644 __pycache__/statements.cpython-37.pyc create mode 100644 les1/Expressions.py create mode 100644 les1/opdr2.py create mode 100644 les1/opdr3.py create mode 100644 les1/opdr4.py create mode 100644 les2/opdr1.py create mode 100644 les2/opdr2.py create mode 100644 les2/opdr3.py diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..92a2fa2 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,70 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Python: Current File (Integrated Terminal)", + "type": "python", + "request": "launch", + "program": "${file}", + "console": "integratedTerminal" + }, + { + "name": "Python: Remote Attach", + "type": "python", + "request": "attach", + "port": 5678, + "host": "localhost", + "pathMappings": [ + { + "localRoot": "${workspaceFolder}", + "remoteRoot": "." + } + ] + }, + { + "name": "Python: Module", + "type": "python", + "request": "launch", + "module": "enter-your-module-name-here", + "console": "integratedTerminal" + }, + { + "name": "Python: Django", + "type": "python", + "request": "launch", + "program": "${workspaceFolder}/manage.py", + "console": "integratedTerminal", + "args": [ + "runserver", + "--noreload", + "--nothreading" + ], + "django": true + }, + { + "name": "Python: Flask", + "type": "python", + "request": "launch", + "module": "flask", + "env": { + "FLASK_APP": "app.py" + }, + "args": [ + "run", + "--no-debugger", + "--no-reload" + ], + "jinja": true + }, + { + "name": "Python: Current File (External Terminal)", + "type": "python", + "request": "launch", + "program": "${file}", + "console": "externalTerminal" + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..647fb22 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,12 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "echo", + "type": "shell", + "command": "python3 ~/python/Expressions.py" + } + ] +} \ No newline at end of file diff --git a/__pycache__/opdr3.cpython-37.pyc b/__pycache__/opdr3.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1b223a93db96a13df95e644c729105d5d87dd0ae GIT binary patch literal 296 zcmXwyu};H442I8XdO0Gcf~gV{YZo%GB82(?ENmw+Tys_v$lXP`Yo+ouF!BJrj8~?- zLMPlJZ2g~q%a*;as#0+H%kkx#>(8nAkDSdTE3O$L%?jCeS*$y zuIF~HrIorsc1wYBDQv-&rIm$eu~HM?5l@q3P6dOcGh>7O5pGDf#=N5^vAUo#CX>3D zx+W4Bf(_*kjVEYG?L!#7F^;OVixK@k;5K4UrD@uPe$s7UwIi%u$O|BZ`T#6!Co!1#)C6L?irq@(X<+05cn6*#D^p&f z6PF_HbieG;N~4mUi8XpNBrhu;M=#oUiIOII2Cp lhI)TWZSeK{haCA7Z}z8A-@0HAJ>3EC#EPLovR4;M_yx%jOPT-x literal 0 HcmV?d00001 diff --git a/les1/Expressions.py b/les1/Expressions.py new file mode 100644 index 0000000..c3a3862 --- /dev/null +++ b/les1/Expressions.py @@ -0,0 +1,6 @@ +print(5, type(5)) +print(5.0, type(5.0)) +print(5 % 2, type(5 % 2)) +print(5 > 1, type(5 > 1)) +print('5', type('5')) +print(5 * 2, type(5*2)) \ No newline at end of file diff --git a/les1/opdr2.py b/les1/opdr2.py new file mode 100644 index 0000000..f775a54 --- /dev/null +++ b/les1/opdr2.py @@ -0,0 +1,9 @@ +w1 = "Supercalifragilisticexpialidocious" +w2 = "Antidisestablishmentarianism" +w3 = "Honorificabilitudinitatibus" +composers = ['Berlioz', 'Borodin', 'Brian', 'Bartok', 'Bellini', 'Buxtehude', 'Bernstein'] +composers.sort() +print(len(w1)) +print("ice" in w1) +print(w2 > w3) +print(composers[0]) \ No newline at end of file diff --git a/les1/opdr3.py b/les1/opdr3.py new file mode 100644 index 0000000..5d8db63 --- /dev/null +++ b/les1/opdr3.py @@ -0,0 +1,8 @@ +import statistics +a = 6 +b = 7 +c = statistics.mean([a,b]) +voornaam = "marcel" +tussenvoegsel = "" +achternaam = "haazen" +mijnnaam = (voornaam + " " + tussenvoegsel + "" + achternaam) diff --git a/les1/opdr4.py b/les1/opdr4.py new file mode 100644 index 0000000..4617ef2 --- /dev/null +++ b/les1/opdr4.py @@ -0,0 +1,14 @@ +import statistics +a = 6 +b = 7 +c = statistics.mean([a,b]) +voornaam = "marcel" +tussenvoegsel = " " +achternaam = "haazen" +mijnnaam = (voornaam + " " + tussenvoegsel + "" + achternaam) +if(75 > a) and (75 < b): + print(False) +print(len(mijnnaam) == sum([len(voornaam),len(tussenvoegsel),len(achternaam)])) +print(len(mijnnaam) == len(tussenvoegsel)) +print(len(mijnnaam) == 5 * len(tussenvoegsel)) +print(tussenvoegsel in achternaam) \ No newline at end of file diff --git a/les2/opdr1.py b/les2/opdr1.py new file mode 100644 index 0000000..78c81ec --- /dev/null +++ b/les2/opdr1.py @@ -0,0 +1,6 @@ +favorieten = ['nano'] +print(favorieten) +favorieten.append('manila') +print(favorieten) +favorieten[1]="reol" +print(favorieten) \ No newline at end of file diff --git a/les2/opdr2.py b/les2/opdr2.py new file mode 100644 index 0000000..9c79aa4 --- /dev/null +++ b/les2/opdr2.py @@ -0,0 +1,5 @@ +a = [-1,4,6,12,15,-6,22] +tmp = sorted(a) +min = tmp[0] +max = tmp[-1] +print("bereik", max - min) \ No newline at end of file diff --git a/les2/opdr3.py b/les2/opdr3.py new file mode 100644 index 0000000..6b6c803 --- /dev/null +++ b/les2/opdr3.py @@ -0,0 +1,4 @@ +from collections import Counter +letters = ['A', 'C', 'B', 'B', 'C', 'A', 'C', 'C', 'B'] +totaal = Counter(letters) +print(totaal)