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 0000000..1b223a9 Binary files /dev/null and b/__pycache__/opdr3.cpython-37.pyc differ diff --git a/__pycache__/statements.cpython-37.pyc b/__pycache__/statements.cpython-37.pyc new file mode 100644 index 0000000..ae9fe71 Binary files /dev/null and b/__pycache__/statements.cpython-37.pyc differ 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)