Skip to content

Commit 7e3677c

Browse files
committed
spelling errors
1 parent becd511 commit 7e3677c

3 files changed

Lines changed: 84 additions & 12 deletions

File tree

‎Week_0_python/.OTTER_LOG‎

3.34 KB
Binary file not shown.

‎Week_0_python/Intro_assignment.ipynb‎

Lines changed: 83 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 3,
5+
"execution_count": 1,
66
"metadata": {
77
"deletable": false,
88
"editable": false
@@ -36,7 +36,7 @@
3636
},
3737
{
3838
"cell_type": "code",
39-
"execution_count": null,
39+
"execution_count": 2,
4040
"metadata": {},
4141
"outputs": [],
4242
"source": [
@@ -72,11 +72,19 @@
7272
},
7373
{
7474
"cell_type": "code",
75-
"execution_count": null,
75+
"execution_count": 3,
7676
"metadata": {
7777
"tags": []
7878
},
79-
"outputs": [],
79+
"outputs": [
80+
{
81+
"name": "stdout",
82+
"output_type": "stream",
83+
"text": [
84+
"foo data1.csv\n"
85+
]
86+
}
87+
],
8088
"source": [
8189
"# TODO: Create a string from the following variables\n",
8290
"\n",
@@ -86,19 +94,33 @@
8694
"\n",
8795
"\n",
8896
"# TODO: replace ... with string creation\n",
89-
"data_file_name = ...\n",
97+
"data_file_name = \"data1.csv\"\n",
9098
"\n",
9199
"# This is what the autograder will check\n",
92-
"assert data_file_name == \"data1.csv\""
100+
"assert data_file_name == \"data1.csv\"\n",
101+
"\n",
102+
"print(f\"foo {data_file_name}\")"
93103
]
94104
},
95105
{
96106
"cell_type": "code",
97-
"execution_count": null,
107+
"execution_count": 4,
98108
"metadata": {
99109
"tags": []
100110
},
101-
"outputs": [],
111+
"outputs": [
112+
{
113+
"ename": "AssertionError",
114+
"evalue": "",
115+
"output_type": "error",
116+
"traceback": [
117+
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
118+
"\u001b[0;31mAssertionError\u001b[0m Traceback (most recent call last)",
119+
"Cell \u001b[0;32mIn[4], line 21\u001b[0m\n\u001b[1;32m 18\u001b[0m new_file_name \u001b[38;5;241m=\u001b[39m file_name\n\u001b[1;32m 20\u001b[0m \u001b[38;5;66;03m# This is what the autograder will check\u001b[39;00m\n\u001b[0;32m---> 21\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m new_file_name \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfname1.csv\u001b[39m\u001b[38;5;124m\"\u001b[39m\n",
120+
"\u001b[0;31mAssertionError\u001b[0m: "
121+
]
122+
}
123+
],
102124
"source": [
103125
"file_name = \"fname.txt\"\n",
104126
"which_one = 1\n",
@@ -125,12 +147,62 @@
125147
},
126148
{
127149
"cell_type": "code",
128-
"execution_count": null,
150+
"execution_count": 9,
129151
"metadata": {
130152
"deletable": false,
131153
"editable": false
132154
},
133-
"outputs": [],
155+
"outputs": [
156+
{
157+
"data": {
158+
"text/html": [
159+
"<p><strong style='color: red;'><pre style='display: inline;'>Strings</pre> results:</strong></p><p><strong><pre style='display: inline;'>Strings - 1</pre> result:</strong></p><pre> ✅ Test case passed</pre><p><strong><pre style='display: inline;'>Strings - 2</pre> result:</strong></p><pre> ❌ Test case failed\n",
160+
" Trying:\n",
161+
" assert new_file_name == 'fname1.csv'\n",
162+
" Expecting nothing\n",
163+
" **********************************************************************\n",
164+
" Line 1, in Strings 1\n",
165+
" Failed example:\n",
166+
" assert new_file_name == 'fname1.csv'\n",
167+
" Exception raised:\n",
168+
" Traceback (most recent call last):\n",
169+
" File \"/opt/anaconda3/lib/python3.12/doctest.py\", line 1368, in __run\n",
170+
" exec(compile(example.source, filename, \"single\",\n",
171+
" File \"<doctest Strings 1[0]>\", line 1, in <module>\n",
172+
" assert new_file_name == 'fname1.csv'\n",
173+
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
174+
" AssertionError\n",
175+
"</pre>"
176+
],
177+
"text/plain": [
178+
"Strings results:\n",
179+
" Strings - 1 result:\n",
180+
" ✅ Test case passed\n",
181+
"\n",
182+
" Strings - 2 result:\n",
183+
" ❌ Test case failed\n",
184+
" Trying:\n",
185+
" assert new_file_name == 'fname1.csv'\n",
186+
" Expecting nothing\n",
187+
" **********************************************************************\n",
188+
" Line 1, in Strings 1\n",
189+
" Failed example:\n",
190+
" assert new_file_name == 'fname1.csv'\n",
191+
" Exception raised:\n",
192+
" Traceback (most recent call last):\n",
193+
" File \"/opt/anaconda3/lib/python3.12/doctest.py\", line 1368, in __run\n",
194+
" exec(compile(example.source, filename, \"single\",\n",
195+
" File \"<doctest Strings 1[0]>\", line 1, in <module>\n",
196+
" assert new_file_name == 'fname1.csv'\n",
197+
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n",
198+
" AssertionError"
199+
]
200+
},
201+
"execution_count": 9,
202+
"metadata": {},
203+
"output_type": "execute_result"
204+
}
205+
],
134206
"source": [
135207
"grader.check(\"Strings\")"
136208
]
@@ -346,7 +418,7 @@
346418
"name": "python",
347419
"nbconvert_exporter": "python",
348420
"pygments_lexer": "ipython3",
349-
"version": "3.11.7"
421+
"version": "3.12.4"
350422
},
351423
"otter": {
352424
"OK_FORMAT": true,

‎Week_1_data_structures/lec_act_1_data_structures.ipynb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"\n",
9999
"# You might find numpy's count_nonzero useful here \n",
100100
"\n",
101-
"\n",
101+
"np.countnonzero(my_example < 0)\n",
102102
"# TODO Make a 100 x 200 array of numbers between 0 and 1 using the example above (numpy.random.random function)\n",
103103
"my_made_up_np_array = ...\n",
104104
"# TODO Use arithmatic to change numbers in the range 0 to 1 to be in the range -1 to 1 instead\n",

0 commit comments

Comments
 (0)