Skip to content

Commit 5361b57

Browse files
Addressed Issues
Addressed issues raised after PyFun iteration
1 parent 9815716 commit 5361b57

12 files changed

+147
-759
lines changed
File renamed without changes.

lessons/Part1/01_introduction.ipynb

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"\n",
3434
"## Coding Strategies\n",
3535
"\n",
36-
"Planning ahead can help mitigate time spent dealing with bugs and errors in code. General steps for defensive coding are:\n",
36+
"Planning ahead can help mitigate time spent dealing with bugs and errors in code. General steps for resilient coding are:\n",
3737
"\n",
3838
"1. State the goals of your code as clearly as possible.\n",
3939
"2. Plan out the general logic of steps needed to achieve the goal.\n",
@@ -75,13 +75,6 @@
7575
"\n",
7676
"Don't reinvent the wheel - learning how to find the answer to the issues you run into is a critical part of becoming a capable programmer!"
7777
]
78-
},
79-
{
80-
"cell_type": "code",
81-
"execution_count": null,
82-
"metadata": {},
83-
"outputs": [],
84-
"source": []
8578
}
8679
],
8780
"metadata": {

lessons/Part1/02_jupyter_notebooks.ipynb

Lines changed: 9 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"source": [
2121
"## Navigating Jupyter Notebooks\n",
2222
"\n",
23-
"In Jupyter Notebooks, code is divided into cells which can each be run separately. This is the main distinction between Jupyter Notebook `.ipynb` format and Python script `.py` format. Running a cell is done with a key combination: `Shift+Enter`. `Shift+Enter` will run the code in the selecte cell and then automatically move to the following cell.\n",
23+
"In Jupyter Notebooks, code is divided into cells which can each be run separately. This is the main distinction between Jupyter Notebook `.ipynb` format and Python script `.py` format. Running a cell is done with a key combination: `Shift+Enter`. `Shift+Enter` will run the code in the selected cell and then automatically move to the following cell.\n",
2424
"\n",
2525
"Try to run the following code using `Shift+Enter` now. \n",
2626
"\n",
@@ -29,17 +29,9 @@
2929
},
3030
{
3131
"cell_type": "code",
32-
"execution_count": 1,
32+
"execution_count": null,
3333
"metadata": {},
34-
"outputs": [
35-
{
36-
"name": "stdout",
37-
"output_type": "stream",
38-
"text": [
39-
"Hello World!\n"
40-
]
41-
}
42-
],
34+
"outputs": [],
4335
"source": [
4436
"print(\"Hello World!\")"
4537
]
@@ -57,17 +49,9 @@
5749
},
5850
{
5951
"cell_type": "code",
60-
"execution_count": 2,
52+
"execution_count": null,
6153
"metadata": {},
62-
"outputs": [
63-
{
64-
"name": "stdout",
65-
"output_type": "stream",
66-
"text": [
67-
"3\n"
68-
]
69-
}
70-
],
54+
"outputs": [],
7155
"source": [
7256
"a = 1 + 2\n",
7357
"print(a)"
@@ -132,17 +116,9 @@
132116
},
133117
{
134118
"cell_type": "code",
135-
"execution_count": 6,
119+
"execution_count": null,
136120
"metadata": {},
137-
"outputs": [
138-
{
139-
"name": "stdout",
140-
"output_type": "stream",
141-
"text": [
142-
"And three shall be the count.\n"
143-
]
144-
}
145-
],
121+
"outputs": [],
146122
"source": [
147123
"mystring = \"And three shall be the count.\" \n",
148124
"\n",
@@ -158,17 +134,9 @@
158134
},
159135
{
160136
"cell_type": "code",
161-
"execution_count": 7,
137+
"execution_count": null,
162138
"metadata": {},
163-
"outputs": [
164-
{
165-
"name": "stdout",
166-
"output_type": "stream",
167-
"text": [
168-
"And three shall be the count.\n"
169-
]
170-
}
171-
],
139+
"outputs": [],
172140
"source": [
173141
"print(mystring)"
174142
]
@@ -215,31 +183,6 @@
215183
"outputs": [],
216184
"source": []
217185
},
218-
{
219-
"cell_type": "markdown",
220-
"metadata": {},
221-
"source": [
222-
"### Commenting\n",
223-
"\n",
224-
"We will discuss how and why to comment code later in this series, but we will introduce it now because it's useful when you temporarily don't want to run a section of code.\n",
225-
"\n",
226-
"Simply place a pound sign `#` at the beginning of the line, and that line won't run. Any uncommented lines will be treated as code.\n",
227-
"\n",
228-
"Try running the cell below, then comment out `bad_thing`, and run it again. What changes?\n"
229-
]
230-
},
231-
{
232-
"cell_type": "code",
233-
"execution_count": null,
234-
"metadata": {},
235-
"outputs": [],
236-
"source": [
237-
"good_thing = 1+1\n",
238-
"\n",
239-
"This line should be commented\n",
240-
"bad_thing_1 = 'a' * 'b'"
241-
]
242-
},
243186
{
244187
"cell_type": "markdown",
245188
"metadata": {},

lessons/Part1/03_variables.ipynb

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,6 @@
5757
"print(\"Year:\", year, \".Month:\", month)"
5858
]
5959
},
60-
{
61-
"cell_type": "markdown",
62-
"metadata": {},
63-
"source": [
64-
"In addition, the argument `sep` (short for separator) can be used to control what goes in between each item."
65-
]
66-
},
67-
{
68-
"cell_type": "code",
69-
"execution_count": null,
70-
"metadata": {},
71-
"outputs": [],
72-
"source": [
73-
"print(\"Year:\", year, \". Month:\", month, sep = '')"
74-
]
75-
},
7660
{
7761
"cell_type": "markdown",
7862
"metadata": {
@@ -83,8 +67,7 @@
8367
"\n",
8468
"* Variable names **must** follow a few rules:\n",
8569
" * They cannot start with a digit.\n",
86-
" * They cannot contain spaces, quotation marks, or other punctuation.\n",
87-
" * They *may* contain an underscore (typically used to separate words in long variable names).\n",
70+
" * They cannot contain spaces, quotation marks, or other punctuation (except underscore).\n",
8871
" \n",
8972
"Not following these rules will result in an error in Python. \n",
9073
"\n",
@@ -178,7 +161,7 @@
178161
"source": [
179162
"## Challenge 2: Words to Code\n",
180163
"\n",
181-
"Translate the following line into code and save the result to a variable. \n",
164+
"Translate the following line into code and save the result to a variable. Start by writing out each operation as a separate step, *then* translate it to code.\n",
182165
"\n",
183166
"Divide 15 by the sum of a and three times b. Multiply the result by 2 and raise it to the 3rd power. What is the result?\n",
184167
"\n",
@@ -251,13 +234,6 @@
251234
"source": [
252235
"This is a common technique that is used for swapping variables around. However, often we might choose to just use new variables, rather than overwrite the ones here. Can you think of a reason why we might avoid overwriting a variable?"
253236
]
254-
},
255-
{
256-
"cell_type": "code",
257-
"execution_count": null,
258-
"metadata": {},
259-
"outputs": [],
260-
"source": []
261237
}
262238
],
263239
"metadata": {

0 commit comments

Comments
 (0)