|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "code", |
5 | | - "execution_count": 1, |
| 5 | + "execution_count": null, |
6 | 6 | "metadata": { |
7 | 7 | "deletable": false, |
8 | 8 | "editable": false |
|
49 | 49 | }, |
50 | 50 | { |
51 | 51 | "cell_type": "code", |
52 | | - "execution_count": null, |
| 52 | + "execution_count": 3, |
53 | 53 | "metadata": {}, |
54 | 54 | "outputs": [], |
55 | 55 | "source": [ |
|
72 | 72 | }, |
73 | 73 | { |
74 | 74 | "cell_type": "code", |
75 | | - "execution_count": 3, |
| 75 | + "execution_count": null, |
76 | 76 | "metadata": { |
77 | 77 | "tags": [] |
78 | 78 | }, |
79 | | - "outputs": [ |
80 | | - { |
81 | | - "name": "stdout", |
82 | | - "output_type": "stream", |
83 | | - "text": [ |
84 | | - "foo data1.csv\n" |
85 | | - ] |
86 | | - } |
87 | | - ], |
| 79 | + "outputs": [], |
88 | 80 | "source": [ |
89 | 81 | "# TODO: Create a string from the following variables\n", |
90 | 82 | "\n", |
|
94 | 86 | "\n", |
95 | 87 | "\n", |
96 | 88 | "# TODO: replace ... with string creation\n", |
97 | | - "data_file_name = \"data1.csv\"\n", |
| 89 | + "data_file_name = ...\n", |
98 | 90 | "\n", |
99 | 91 | "# This is what the autograder will check\n", |
100 | | - "assert data_file_name == \"data1.csv\"\n", |
101 | | - "\n", |
102 | | - "print(f\"foo {data_file_name}\")" |
| 92 | + "assert data_file_name == \"data1.csv\"\n" |
103 | 93 | ] |
104 | 94 | }, |
105 | 95 | { |
106 | 96 | "cell_type": "code", |
107 | | - "execution_count": 4, |
| 97 | + "execution_count": null, |
108 | 98 | "metadata": { |
109 | 99 | "tags": [] |
110 | 100 | }, |
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 | | - ], |
| 101 | + "outputs": [], |
124 | 102 | "source": [ |
125 | 103 | "file_name = \"fname.txt\"\n", |
126 | 104 | "which_one = 1\n", |
|
147 | 125 | }, |
148 | 126 | { |
149 | 127 | "cell_type": "code", |
150 | | - "execution_count": 9, |
| 128 | + "execution_count": null, |
151 | 129 | "metadata": { |
152 | 130 | "deletable": false, |
153 | 131 | "editable": false |
154 | 132 | }, |
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 | | - ], |
| 133 | + "outputs": [], |
206 | 134 | "source": [ |
207 | 135 | "grader.check(\"Strings\")" |
208 | 136 | ] |
|
404 | 332 | ], |
405 | 333 | "metadata": { |
406 | 334 | "kernelspec": { |
407 | | - "display_name": "base", |
| 335 | + "display_name": "Python 3", |
408 | 336 | "language": "python", |
409 | 337 | "name": "python3" |
410 | 338 | }, |
|
418 | 346 | "name": "python", |
419 | 347 | "nbconvert_exporter": "python", |
420 | 348 | "pygments_lexer": "ipython3", |
421 | | - "version": "3.12.4" |
| 349 | + "version": "3.12.7" |
422 | 350 | }, |
423 | 351 | "otter": { |
424 | 352 | "OK_FORMAT": true, |
|
0 commit comments