Skip to content

Commit 888d6a9

Browse files
authored
Create oefeningen_hoofdstuk3.ipynb
1 parent d448274 commit 888d6a9

1 file changed

Lines changed: 203 additions & 0 deletions

File tree

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
import json
2+
3+
# De inhoud van de notebook (theorie + oefeningen)
4+
notebook_content = {
5+
"cells": [
6+
{
7+
"cell_type": "markdown",
8+
"metadata": {},
9+
"source": [
10+
"# Oefeningen: Afronden, machten en wortels\n",
11+
"\n",
12+
"In deze notebook ga je oefenen met de theorie. Succes!\n",
13+
"\n",
14+
"---"
15+
]
16+
},
17+
{
18+
"cell_type": "markdown",
19+
"metadata": {},
20+
"source": [
21+
"## 1. Oefeningen: Afronden\n",
22+
"\n",
23+
"### Opdracht 1a: Standaard afronden\n",
24+
"Maak een variabele `cijfer = 7.5`. Gebruik de `round()` functie om dit cijfer af te ronden. Probeer daarna hetzelfde met `cijfer = 8.5`."
25+
]
26+
},
27+
{
28+
"cell_type": "code",
29+
"execution_count": None,
30+
"metadata": {},
31+
"outputs": [],
32+
"source": [
33+
"# Typ hier je code voor opdracht 1a"
34+
]
35+
},
36+
{
37+
"cell_type": "markdown",
38+
"metadata": {},
39+
"source": [
40+
"<details>\n",
41+
"<summary>👉 Klik hier voor de uitwerking van 1a</summary>\n",
42+
"\n",
43+
"```python\n",
44+
"cijfer1 = 7.5\n",
45+
"print(round(cijfer1)) # Resultaat is 8 (even getal)\n",
46+
"\n",
47+
"cijfer2 = 8.5\n",
48+
"print(round(cijfer2)) # Resultaat is 8 (even getal)\n",
49+
"```\n",
50+
"</details>"
51+
]
52+
},
53+
{
54+
"cell_type": "markdown",
55+
"metadata": {},
56+
"source": [
57+
"### Opdracht 1b: Omhoog en omlaag (math)\n",
58+
"Importeer de `math` module. Rond het getal `4.1` af naar boven. Rond daarna het getal `9.9` af naar beneden."
59+
]
60+
},
61+
{
62+
"cell_type": "code",
63+
"execution_count": None,
64+
"metadata": {},
65+
"outputs": [],
66+
"source": [
67+
"import math\n",
68+
"# Maak de opdracht af"
69+
]
70+
},
71+
{
72+
"cell_type": "markdown",
73+
"metadata": {},
74+
"source": [
75+
"<details>\n",
76+
"<summary>👉 Klik hier voor de uitwerking van 1b</summary>\n",
77+
"\n",
78+
"```python\n",
79+
"import math\n",
80+
"print(math.ceil(4.1)) # Resultaat: 5\n",
81+
"print(math.floor(9.9)) # Resultaat: 9\n",
82+
"```\n",
83+
"</details>"
84+
]
85+
},
86+
{
87+
"cell_type": "markdown",
88+
"metadata": {},
89+
"source": [
90+
"--- \n",
91+
"## 2. Oefeningen: Machtsverheffen\n",
92+
"\n",
93+
"### Opdracht 2a: De operator\n",
94+
"Bereken $3^4$ met behulp van de `**` operator."
95+
]
96+
},
97+
{
98+
"cell_type": "code",
99+
"execution_count": None,
100+
"metadata": {},
101+
"outputs": [],
102+
"source": [
103+
"# Typ hier je code"
104+
]
105+
},
106+
{
107+
"cell_type": "markdown",
108+
"metadata": {},
109+
"source": [
110+
"<details>\n",
111+
"<summary>👉 Klik hier voor de uitwerking van 2a</summary>\n",
112+
"\n",
113+
"```python\n",
114+
"print(3 ** 4) # Resultaat: 81\n",
115+
"```\n",
116+
"</details>"
117+
]
118+
},
119+
{
120+
"cell_type": "markdown",
121+
"metadata": {},
122+
"source": [
123+
"### Opdracht 2b: De pow() functies\n",
124+
"Bereken $5^3$ met `math.pow()`. Wat valt je op aan het getal?"
125+
]
126+
},
127+
{
128+
"cell_type": "code",
129+
"execution_count": None,
130+
"metadata": {},
131+
"outputs": [],
132+
"source": [
133+
"import math\n",
134+
"# Typ hier je code"
135+
]
136+
},
137+
{
138+
"cell_type": "markdown",
139+
"metadata": {},
140+
"source": [
141+
"<details>\n",
142+
"<summary>👉 Klik hier voor de uitwerking van 2b</summary>\n",
143+
"\n",
144+
"```python\n",
145+
"import math\n",
146+
"print(math.pow(5, 3)) # Resultaat: 125.0 (het is een float!)\n",
147+
"```\n",
148+
"</details>"
149+
]
150+
},
151+
{
152+
"cell_type": "markdown",
153+
"metadata": {},
154+
"source": [
155+
"--- \n",
156+
"## 3. Oefeningen: Wortels\n",
157+
"\n",
158+
"### Opdracht 3a: Worteltrekken\n",
159+
"Bereken de wortel van `144` met `math.sqrt()`."
160+
]
161+
},
162+
{
163+
"cell_type": "code",
164+
"execution_count": None,
165+
"metadata": {},
166+
"outputs": [],
167+
"source": [
168+
"import math\n",
169+
"# Typ hier je code"
170+
]
171+
},
172+
{
173+
"cell_type": "markdown",
174+
"metadata": {},
175+
"source": [
176+
"<details>\n",
177+
"<summary>👉 Klik hier voor de uitwerking van 3a</summary>\n",
178+
"\n",
179+
"```python\n",
180+
"import math\n",
181+
"print(math.sqrt(144)) # Resultaat: 12.0\n",
182+
"```\n",
183+
"</details>"
184+
]
185+
}
186+
],
187+
"metadata": {
188+
"kernelspec": {
189+
"display_name": "Python 3",
190+
"language": "python",
191+
"name": "python3"
192+
},
193+
"language_info": {
194+
"name": "python"
195+
}
196+
},
197+
"nbformat": 4,
198+
"nbformat_minor": 4
199+
}
200+
201+
202+
203+
print("Bestand 'Oefeningen_Python.ipynb' is succesvol aangemaakt!")

0 commit comments

Comments
 (0)