Browse Source

Uploaded assignemtns

master
Marcel Haazen 4 years ago
parent
commit
8aae5fe21b
5 changed files with 82 additions and 0 deletions
  1. +3
    -0
      .vscode/settings.json
  2. +19
    -0
      Les 5/5-4.py
  3. +20
    -0
      Les 5/5-5.py
  4. +18
    -0
      Les 5/5-6.py
  5. +22
    -0
      les 6/6-1.py

+ 3
- 0
.vscode/settings.json View File

@ -0,0 +1,3 @@
{
"python.pythonPath": "/usr/bin/python3"
}

+ 19
- 0
Les 5/5-4.py View File

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

+ 20
- 0
Les 5/5-5.py View File

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

+ 18
- 0
Les 5/5-6.py View File

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

+ 22
- 0
les 6/6-1.py View File

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

Loading…
Cancel
Save