Skip to content

Commit 0476acf

Browse files
committed
updated notebooks
1 parent 98ab57e commit 0476acf

File tree

4 files changed

+662
-228
lines changed

4 files changed

+662
-228
lines changed

01_python_basics/00_trailer.ipynb

Lines changed: 603 additions & 198 deletions
Large diffs are not rendered by default.

01_python_basics/01_our_first_juptyer_notebook.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
],
104104
"metadata": {
105105
"kernelspec": {
106-
"display_name": "Python 3",
106+
"display_name": "Python 3 (ipykernel)",
107107
"language": "python",
108108
"name": "python3"
109109
},
@@ -117,7 +117,7 @@
117117
"name": "python",
118118
"nbconvert_exporter": "python",
119119
"pygments_lexer": "ipython3",
120-
"version": "3.9.2"
120+
"version": "3.9.10"
121121
}
122122
},
123123
"nbformat": 4,

01_python_basics/02_Math_in_python.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@
428428
],
429429
"metadata": {
430430
"kernelspec": {
431-
"display_name": "Python 3",
431+
"display_name": "Python 3 (ipykernel)",
432432
"language": "python",
433433
"name": "python3"
434434
},
@@ -442,7 +442,7 @@
442442
"name": "python",
443443
"nbconvert_exporter": "python",
444444
"pygments_lexer": "ipython3",
445-
"version": "3.9.2"
445+
"version": "3.9.10"
446446
}
447447
},
448448
"nbformat": 4,

01_python_basics/03_Basic_types.ipynb

Lines changed: 55 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
},
2828
{
2929
"cell_type": "code",
30-
"execution_count": 3,
30+
"execution_count": 2,
3131
"id": "western-depth",
3232
"metadata": {},
3333
"outputs": [
@@ -37,7 +37,7 @@
3737
"int"
3838
]
3939
},
40-
"execution_count": 3,
40+
"execution_count": 2,
4141
"metadata": {},
4242
"output_type": "execute_result"
4343
}
@@ -56,7 +56,7 @@
5656
},
5757
{
5858
"cell_type": "code",
59-
"execution_count": 4,
59+
"execution_count": 3,
6060
"id": "expanded-atlantic",
6161
"metadata": {},
6262
"outputs": [],
@@ -66,7 +66,7 @@
6666
},
6767
{
6868
"cell_type": "code",
69-
"execution_count": 5,
69+
"execution_count": 4,
7070
"id": "declared-stadium",
7171
"metadata": {},
7272
"outputs": [
@@ -76,7 +76,7 @@
7676
"float"
7777
]
7878
},
79-
"execution_count": 5,
79+
"execution_count": 4,
8080
"metadata": {},
8181
"output_type": "execute_result"
8282
}
@@ -95,7 +95,7 @@
9595
},
9696
{
9797
"cell_type": "code",
98-
"execution_count": 6,
98+
"execution_count": 5,
9999
"id": "strange-maria",
100100
"metadata": {},
101101
"outputs": [],
@@ -105,7 +105,7 @@
105105
},
106106
{
107107
"cell_type": "code",
108-
"execution_count": 7,
108+
"execution_count": 6,
109109
"id": "patient-insider",
110110
"metadata": {},
111111
"outputs": [
@@ -115,7 +115,7 @@
115115
"float"
116116
]
117117
},
118-
"execution_count": 7,
118+
"execution_count": 6,
119119
"metadata": {},
120120
"output_type": "execute_result"
121121
}
@@ -135,7 +135,7 @@
135135
},
136136
{
137137
"cell_type": "code",
138-
"execution_count": 1,
138+
"execution_count": 7,
139139
"id": "severe-democracy",
140140
"metadata": {},
141141
"outputs": [],
@@ -154,7 +154,7 @@
154154
},
155155
{
156156
"cell_type": "code",
157-
"execution_count": 2,
157+
"execution_count": 8,
158158
"id": "capable-vegetable",
159159
"metadata": {},
160160
"outputs": [
@@ -164,7 +164,7 @@
164164
"'RobertHaase'"
165165
]
166166
},
167-
"execution_count": 2,
167+
"execution_count": 8,
168168
"metadata": {},
169169
"output_type": "execute_result"
170170
}
@@ -175,7 +175,7 @@
175175
},
176176
{
177177
"cell_type": "code",
178-
"execution_count": 3,
178+
"execution_count": 9,
179179
"id": "configured-bacteria",
180180
"metadata": {},
181181
"outputs": [
@@ -185,7 +185,7 @@
185185
"'Robert Haase'"
186186
]
187187
},
188-
"execution_count": 3,
188+
"execution_count": 9,
189189
"metadata": {},
190190
"output_type": "execute_result"
191191
}
@@ -196,7 +196,7 @@
196196
},
197197
{
198198
"cell_type": "code",
199-
"execution_count": 4,
199+
"execution_count": 10,
200200
"id": "5d94516d",
201201
"metadata": {},
202202
"outputs": [
@@ -215,7 +215,7 @@
215215
},
216216
{
217217
"cell_type": "code",
218-
"execution_count": 5,
218+
"execution_count": 11,
219219
"id": "8a0ce0be",
220220
"metadata": {},
221221
"outputs": [
@@ -250,7 +250,7 @@
250250
},
251251
{
252252
"cell_type": "code",
253-
"execution_count": 11,
253+
"execution_count": 12,
254254
"id": "naughty-panic",
255255
"metadata": {},
256256
"outputs": [
@@ -261,7 +261,7 @@
261261
"traceback": [
262262
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
263263
"\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)",
264-
"\u001b[1;32m<ipython-input-11-81536da2bedb>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mfirst_name\u001b[0m \u001b[1;33m+\u001b[0m \u001b[0ma\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
264+
"Input \u001b[1;32mIn [12]\u001b[0m, in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mfirst_name\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m+\u001b[39;49m\u001b[43m \u001b[49m\u001b[43ma\u001b[49m\n",
265265
"\u001b[1;31mTypeError\u001b[0m: can only concatenate str (not \"int\") to str"
266266
]
267267
}
@@ -280,7 +280,7 @@
280280
},
281281
{
282282
"cell_type": "code",
283-
"execution_count": 12,
283+
"execution_count": 13,
284284
"id": "mental-curve",
285285
"metadata": {},
286286
"outputs": [
@@ -290,7 +290,7 @@
290290
"'Robert5'"
291291
]
292292
},
293-
"execution_count": 12,
293+
"execution_count": 13,
294294
"metadata": {},
295295
"output_type": "execute_result"
296296
}
@@ -309,7 +309,7 @@
309309
},
310310
{
311311
"cell_type": "code",
312-
"execution_count": 13,
312+
"execution_count": 14,
313313
"id": "optical-maker",
314314
"metadata": {},
315315
"outputs": [],
@@ -319,7 +319,7 @@
319319
},
320320
{
321321
"cell_type": "code",
322-
"execution_count": 14,
322+
"execution_count": 15,
323323
"id": "continent-march",
324324
"metadata": {},
325325
"outputs": [
@@ -329,7 +329,7 @@
329329
"5"
330330
]
331331
},
332-
"execution_count": 14,
332+
"execution_count": 15,
333333
"metadata": {},
334334
"output_type": "execute_result"
335335
}
@@ -380,7 +380,7 @@
380380
"traceback": [
381381
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
382382
"\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)",
383-
"\u001b[1;32m<ipython-input-17-a6f1987f81d0>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"hello\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
383+
"Input \u001b[1;32mIn [17]\u001b[0m, in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[38;5;28;43mint\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mhello\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n",
384384
"\u001b[1;31mValueError\u001b[0m: invalid literal for int() with base 10: 'hello'"
385385
]
386386
}
@@ -402,7 +402,7 @@
402402
"traceback": [
403403
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
404404
"\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)",
405-
"\u001b[1;32m<ipython-input-18-f393969df1f0>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
405+
"Input \u001b[1;32mIn [18]\u001b[0m, in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[38;5;28;43mint\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n",
406406
"\u001b[1;31mValueError\u001b[0m: invalid literal for int() with base 10: ''"
407407
]
408408
}
@@ -432,6 +432,35 @@
432432
"int(\"5\")"
433433
]
434434
},
435+
{
436+
"cell_type": "markdown",
437+
"id": "bace6f17-fbfe-4a31-be97-7c274b24dba3",
438+
"metadata": {},
439+
"source": [
440+
"`f`ormatting string in python can also be done like the following, simplifying our life."
441+
]
442+
},
443+
{
444+
"cell_type": "code",
445+
"execution_count": 20,
446+
"id": "49a3d501-a741-4f29-93b8-5aa8f7d688e3",
447+
"metadata": {},
448+
"outputs": [
449+
{
450+
"data": {
451+
"text/plain": [
452+
"'Our lecturer today is Robert Haase'"
453+
]
454+
},
455+
"execution_count": 20,
456+
"metadata": {},
457+
"output_type": "execute_result"
458+
}
459+
],
460+
"source": [
461+
"f\"Our lecturer today is {first_name} {last_name}\""
462+
]
463+
},
435464
{
436465
"cell_type": "markdown",
437466
"id": "offshore-grenada",
@@ -467,7 +496,7 @@
467496
],
468497
"metadata": {
469498
"kernelspec": {
470-
"display_name": "Python 3",
499+
"display_name": "Python 3 (ipykernel)",
471500
"language": "python",
472501
"name": "python3"
473502
},
@@ -481,7 +510,7 @@
481510
"name": "python",
482511
"nbconvert_exporter": "python",
483512
"pygments_lexer": "ipython3",
484-
"version": "3.9.2"
513+
"version": "3.9.10"
485514
}
486515
},
487516
"nbformat": 4,

0 commit comments

Comments
 (0)