Skip to content

Commit d9b334b

Browse files
committed
Small edits to Lab01, mostly just typos/grammar.
Also made some edits to block quotes to work around this bug in markdown-it-py: executablebooks/markdown-it-py#185
1 parent 82730b9 commit d9b334b

File tree

1 file changed

+20
-67
lines changed

1 file changed

+20
-67
lines changed

lab/lab01.ipynb

+20-67
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"\n",
2121
"1. **Setting up GitHub Account.** If you want to learn more about how to work with GitHub and how GitHub internally works, we recommend you to take a look to [The curious coder’s guide to git](https://matthew-brett.github.io/curious-git/). After we all have a GitHub account, we will ask you to complete this [form](https://docs.google.com/forms/d/1LMPPklVx6l7qdcBppK0jxpBWJv-95imkCMoaZxjl6_A/edit) so we can add you to GitHub Classroom. \n",
2222
"\n",
23-
"1. **Warming up with Python.** We will follow the Python tutorial wrote by Jake VanderPlas, [A Whirlwind Tour of Python](https://jakevdp.github.io/WhirlwindTourOfPython/).\n",
23+
"1. **Warming up with Python.** We will follow the Python tutorial written by Jake VanderPlas, [A Whirlwind Tour of Python](https://jakevdp.github.io/WhirlwindTourOfPython).\n",
2424
" \n",
2525
"1. **Debugging in Python/iPython.**\n",
2626
" 1. Debuggin with [pdb](https://docs.python.org/3/library/pdb.html) \n",
@@ -34,55 +34,7 @@
3434
"- Interpreted instead of compiled\n",
3535
"- Clean syntax\n",
3636
"- Object oriented (attributes + methods), convenient language constructs\n",
37-
"- Variables are pointers (speed and memory efficient)"
38-
]
39-
},
40-
{
41-
"cell_type": "code",
42-
"execution_count": 46,
43-
"id": "de3d095b-813e-4fa1-8fdf-e4741f9a44e0",
44-
"metadata": {},
45-
"outputs": [
46-
{
47-
"name": "stdout",
48-
"output_type": "stream",
49-
"text": [
50-
"171\n"
51-
]
52-
}
53-
],
54-
"source": [
55-
"import sys\n",
56-
"\n",
57-
"print(sys.getrefcount(255))"
58-
]
59-
},
60-
{
61-
"cell_type": "code",
62-
"execution_count": 48,
63-
"id": "23946485-73ed-44fd-929e-371ba5de4a55",
64-
"metadata": {},
65-
"outputs": [],
66-
"source": [
67-
"x1 = 255"
68-
]
69-
},
70-
{
71-
"cell_type": "code",
72-
"execution_count": 49,
73-
"id": "300b5087-477e-464c-a66c-1d68b3e70815",
74-
"metadata": {},
75-
"outputs": [
76-
{
77-
"name": "stdout",
78-
"output_type": "stream",
79-
"text": [
80-
"172\n"
81-
]
82-
}
83-
],
84-
"source": [
85-
"print(sys.getrefcount(255))"
37+
"- Variables can access large data structures by reference, without making a copy (speed and memory efficient)."
8638
]
8739
},
8840
{
@@ -119,7 +71,7 @@
11971
"\n",
12072
">\n",
12173
"> Once you have your GitHub account, please take a few minutes to complete this form. \n",
122-
">"
74+
">\n"
12375
]
12476
},
12577
{
@@ -172,7 +124,7 @@
172124
"metadata": {},
173125
"outputs": [],
174126
"source": [
175-
"### .... [To do during the lab] Construct the following funtion\n",
127+
"### .... [To do during the lab] Construct the following function\n",
176128
"\n",
177129
"\n",
178130
"from math import gcd # we import the great common divisor function from math\n",
@@ -403,7 +355,7 @@
403355
"source": [
404356
"### 2.2. Errors and Exceptions\n",
405357
"\n",
406-
"Different kind of errors that occur as we write code include syntax, runtime and semantic errors. Specially for runtime errors, Python give us a clue about what kind or error may happened during the execution of our code. For example,"
358+
"Different kinds of errors that occur as we write code include syntax, runtime and semantic errors. Specially for runtime errors, Python give us a clue about what kind or error may happened during the execution of our code. For example,"
407359
]
408360
},
409361
{
@@ -498,17 +450,26 @@
498450
},
499451
{
500452
"cell_type": "code",
501-
"execution_count": null,
453+
"execution_count": 1,
502454
"id": "ca2d920e-587d-4e9e-a0ee-45da2ddbe92d",
503455
"metadata": {},
504-
"outputs": [],
456+
"outputs": [
457+
{
458+
"name": "stdout",
459+
"output_type": "stream",
460+
"text": [
461+
"I was here\n",
462+
"Something wrong happened\n"
463+
]
464+
}
465+
],
505466
"source": [
506467
"try:\n",
507468
" print(\"I was here\")\n",
508469
" a / b\n",
509470
" print(\"Was I here?\")\n",
510471
"except: \n",
511-
" print(\"Something wrong happen\")"
472+
" print(\"Something wrong happened\")"
512473
]
513474
},
514475
{
@@ -580,9 +541,9 @@
580541
"id": "e8992735-a9c6-4656-81c4-f766362f33a2",
581542
"metadata": {},
582543
"source": [
583-
"## 3. Debuggin in Jupyter \n",
544+
"## 3. Debugging in Jupyter \n",
584545
"\n",
585-
"Jupyter allow us to do post-mortem debugging with the `%debug` command. This is a basic pdb debugger."
546+
"Jupyter allow us to do post-mortem debugging with the `%debug` command. This is a wrapper around the basic [pdb debugger](https://docs.python.org/3/library/pdb.html) that ships with the Python language."
586547
]
587548
},
588549
{
@@ -714,7 +675,7 @@
714675
"\n",
715676
">\n",
716677
"> *A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away.*\n",
717-
">"
678+
">\n"
718679
]
719680
},
720681
{
@@ -753,14 +714,6 @@
753714
"L2 = []"
754715
]
755716
},
756-
{
757-
"cell_type": "code",
758-
"execution_count": null,
759-
"id": "3e3cec38-f8f2-4cbd-a71c-f10b13072f36",
760-
"metadata": {},
761-
"outputs": [],
762-
"source": []
763-
},
764717
{
765718
"cell_type": "code",
766719
"execution_count": 60,

0 commit comments

Comments
 (0)