lesopdracht 1 af
This commit is contained in:
parent
1e74657033
commit
b2143713e9
4
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/1.py
Normal file
4
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/1.py
Normal file
@ -0,0 +1,4 @@
|
||||
namen = ['peter', 'pator', 'piotr', 'pieter', 'pablo']
|
||||
for naam in namen:
|
||||
print(naam)
|
||||
|
6
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/10.py
Normal file
6
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/10.py
Normal file
@ -0,0 +1,6 @@
|
||||
invoer = int(input('Geef een getal broer: '))
|
||||
|
||||
try:
|
||||
print(invoer / 100)
|
||||
except:
|
||||
print('Kan niet door 0 delen gast')
|
8
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/11.py
Normal file
8
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/11.py
Normal file
@ -0,0 +1,8 @@
|
||||
with open('11.txt', 'r') as file:
|
||||
lines = file.readlines()
|
||||
|
||||
iter = 1
|
||||
|
||||
for line in lines:
|
||||
print(str(iter) + ' ' + line.rstrip())
|
||||
iter = iter + 1
|
3
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/11.txt
Normal file
3
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/11.txt
Normal file
@ -0,0 +1,3 @@
|
||||
blabladfalf dsfjsflksjf
|
||||
ddddf dsfjsklfjklsf
|
||||
sfdkfjdkfjdkfjdkfdkfjdkf
|
13
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/12.py
Normal file
13
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/12.py
Normal file
@ -0,0 +1,13 @@
|
||||
def doeIets(x):
|
||||
if x < 10:
|
||||
y = 'x is kleiner dan 10'
|
||||
elif x >= 10 and x < 20:
|
||||
y = 'x tussen 10 en 20'
|
||||
else:
|
||||
y = 'x is groter dan 19'
|
||||
|
||||
return y
|
||||
|
||||
|
||||
z = doeIets(int(input('Geef getal broer: ')))
|
||||
print(z)
|
2
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/13.py
Normal file
2
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/13.py
Normal file
@ -0,0 +1,2 @@
|
||||
nested = [[3, 1, 5], [7, 4, 6]]
|
||||
print(nested[1][1])
|
2
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/14.py
Normal file
2
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/14.py
Normal file
@ -0,0 +1,2 @@
|
||||
import os
|
||||
print(os.getcwd())
|
5
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/2.py
Normal file
5
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/2.py
Normal file
@ -0,0 +1,5 @@
|
||||
grootin = int(input('Geef een getal: '))
|
||||
if grootin > 100:
|
||||
print('GROOT')
|
||||
else:
|
||||
print('klein')
|
3
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/3.py
Normal file
3
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/3.py
Normal file
@ -0,0 +1,3 @@
|
||||
kleuren = {'auto':'rood', 'trein':'geel', 'ambulance':'geel'}
|
||||
for i in kleuren:
|
||||
print(i + ' is ' + kleuren[i])
|
2
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/4.py
Normal file
2
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/4.py
Normal file
@ -0,0 +1,2 @@
|
||||
a = 'The client connects to the server by calling socket()'
|
||||
print(a[4:10])
|
2
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/5.py
Normal file
2
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/5.py
Normal file
@ -0,0 +1,2 @@
|
||||
a = 'The client connects to the server by calling socket()'
|
||||
print(a[-8:])
|
3
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/6.py
Normal file
3
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/6.py
Normal file
@ -0,0 +1,3 @@
|
||||
a = 'The client connects to the server by calling socket()'
|
||||
for i in a[-8:]:
|
||||
print(i, end=" ")
|
10
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/7.py
Normal file
10
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/7.py
Normal file
@ -0,0 +1,10 @@
|
||||
sorteermij = (1, 3, 6, 1, 7, 3, 9, 2, 5, 2)
|
||||
gesorteerd = sorted(sorteermij)
|
||||
print(gesorteerd)
|
||||
|
||||
totaal = 0
|
||||
|
||||
for i in gesorteerd:
|
||||
totaal = totaal + i
|
||||
|
||||
print(totaal)
|
6
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/8.py
Normal file
6
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/8.py
Normal file
@ -0,0 +1,6 @@
|
||||
while True:
|
||||
invoer = input('Geef voer! ')
|
||||
if invoer == ('stop' or 'Stop' or 'STOP'):
|
||||
exit(0)
|
||||
else:
|
||||
print(invoer)
|
7
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/9.py
Normal file
7
Lesopdrachten(formatief)/01 Sockets/Opdracht 1/9.py
Normal file
@ -0,0 +1,7 @@
|
||||
def dubbel(invoer):
|
||||
return int(invoer * 2)
|
||||
|
||||
|
||||
print(dubbel(3))
|
||||
print(dubbel(60))
|
||||
print(dubbel(-3))
|
Reference in New Issue
Block a user