Browse Source

Python stuffs

master
Marcel Haazen 4 years ago
parent
commit
c871e9b781
11 changed files with 134 additions and 0 deletions
  1. +70
    -0
      .vscode/launch.json
  2. +12
    -0
      .vscode/tasks.json
  3. BIN
      __pycache__/opdr3.cpython-37.pyc
  4. BIN
      __pycache__/statements.cpython-37.pyc
  5. +6
    -0
      les1/Expressions.py
  6. +9
    -0
      les1/opdr2.py
  7. +8
    -0
      les1/opdr3.py
  8. +14
    -0
      les1/opdr4.py
  9. +6
    -0
      les2/opdr1.py
  10. +5
    -0
      les2/opdr2.py
  11. +4
    -0
      les2/opdr3.py

+ 70
- 0
.vscode/launch.json View File

@ -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"
}
]
}

+ 12
- 0
.vscode/tasks.json View File

@ -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"
}
]
}

BIN
__pycache__/opdr3.cpython-37.pyc View File


BIN
__pycache__/statements.cpython-37.pyc View File


+ 6
- 0
les1/Expressions.py View File

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

+ 9
- 0
les1/opdr2.py View File

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

+ 8
- 0
les1/opdr3.py View File

@ -0,0 +1,8 @@
import statistics
a = 6
b = 7
c = statistics.mean([a,b])
voornaam = "marcel"
tussenvoegsel = ""
achternaam = "haazen"
mijnnaam = (voornaam + " " + tussenvoegsel + "" + achternaam)

+ 14
- 0
les1/opdr4.py View File

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

+ 6
- 0
les2/opdr1.py View File

@ -0,0 +1,6 @@
favorieten = ['nano']
print(favorieten)
favorieten.append('manila')
print(favorieten)
favorieten[1]="reol"
print(favorieten)

+ 5
- 0
les2/opdr2.py View File

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

+ 4
- 0
les2/opdr3.py View File

@ -0,0 +1,4 @@
from collections import Counter
letters = ['A', 'C', 'B', 'B', 'C', 'A', 'C', 'C', 'B']
totaal = Counter(letters)
print(totaal)

Loading…
Cancel
Save