| @ -0,0 +1,3 @@ | |||||
| print(0==(1==2)) | |||||
| print(2+(3==4)+5==7) | |||||
| print((1<-1)==(3>4)) | |||||
| @ -0,0 +1,3 @@ | |||||
| uurloon = int(input("Wat is je uurloon?")) | |||||
| uren = int(input("Hoeveel uur heb je gewerkt?")) | |||||
| print("Je salaris is", uurloon*uren, "Euro") | |||||
| @ -0,0 +1,3 @@ | |||||
| score = int(input("Wat is je score: ")) | |||||
| if score >= 15: | |||||
| print("Je bent geslaagd") | |||||
| @ -0,0 +1,16 @@ | |||||
| #!/usr/bin/env python3 | |||||
| #title :4-2.py | |||||
| #description :Opdracht 4.2 - If with 2 boolean operators | |||||
| #author :Marcel Haazen | |||||
| #email :marcel@haazen.xyz | |||||
| #date :21-09-2019 - 23:20 | |||||
| #version :0.1 | |||||
| #usage :python3 4-2.py | |||||
| #notes : | |||||
| #python_version :3.7.4 | |||||
| #============================================================================== | |||||
| age = input("Wat is je leeftijd: ") | |||||
| pasport = input("Heb je een Nederlandse paspoort: ") | |||||
| if age >= 18 and pasport == "ja": | |||||
| print("Je mag stemmen") | |||||
| @ -0,0 +1,18 @@ | |||||
| #!/usr/bin/env python3 | |||||
| #title :4-3.py | |||||
| #description :Opdracht 4.3 - If/else | |||||
| #author :Marcel Haazen | |||||
| #email :marcel@haazen.xyz | |||||
| #date :21-09-2019 - 23:22 | |||||
| #version :0.1 | |||||
| #usage :python3 4-3.py | |||||
| #notes : | |||||
| #python_version :3.7.4 | |||||
| #============================================================================== | |||||
| age = int(input("Wat is je leeftijd: ")) | |||||
| pasport = input("Heb je een Nederlandse paspoort: ") | |||||
| if age >= 18 and pasport == "ja": | |||||
| print("Je mag stemmen") | |||||
| else: | |||||
| print("Helaas je mag niet stemmen") | |||||
| @ -0,0 +1,15 @@ | |||||
| #!/usr/bin/env python3 | |||||
| #title :4-4.py | |||||
| #description :Opdracht 4.4 - For, If & strings | |||||
| #author :Marcel Haazen | |||||
| #email :marcel@haazen.xyz | |||||
| #date :21-09-2019 - 23:28 | |||||
| #version :0.1 | |||||
| #usage :python3 4-4.py | |||||
| #notes : | |||||
| #python_version :3.7.4 | |||||
| #============================================================================== | |||||
| days = ['maandag','dinsdag','woensdag'] | |||||
| for day in days: | |||||
| print(day[:2]) | |||||
| @ -0,0 +1,16 @@ | |||||
| #!/usr/bin/env python3 | |||||
| #title :4-5.py | |||||
| #description :Opdracht 4.5 - For, If & numbers | |||||
| #author :Marcel Haazen | |||||
| #email :marcel@haazen.xyz | |||||
| #date :21-09-2019 - 23:30 | |||||
| #version :0.1 | |||||
| #usage :python3 4-5.py | |||||
| #notes : | |||||
| #python_version :3.7.4 | |||||
| #============================================================================== | |||||
| numbers = [1,2,3,4,5,6,7,8,9,10] | |||||
| for number in numbers: | |||||
| if number % 2 == 0: | |||||
| print(number) | |||||
| @ -0,0 +1,16 @@ | |||||
| #!/usr/bin/env python3 | |||||
| #title :4-6.py | |||||
| #description :Opdracht 4.6 - For, If & vowels | |||||
| #author :Marcel Haazen | |||||
| #email :marcel@haazen.xyz | |||||
| #date :21-09-2019 - 23:33 | |||||
| #version :0.1 | |||||
| #usage :python3 4-6.py | |||||
| #notes : | |||||
| #python_version :3.7.4 | |||||
| #============================================================================== | |||||
| s = "Guido van Rossum heeft programmeertaal Python bedacht." | |||||
| vowels = "aeiou" | |||||
| for letter in s: | |||||
| if letter in vowels: | |||||
| print(letter) | |||||