|
38 | 38 | },
|
39 | 39 | {
|
40 | 40 | "cell_type": "code",
|
41 |
| - "execution_count": 1, |
| 41 | + "execution_count": null, |
42 | 42 | "metadata": {
|
43 | 43 | "tags": [
|
44 | 44 | "raises-exception"
|
45 | 45 | ]
|
46 | 46 | },
|
47 |
| - "outputs": [ |
48 |
| - { |
49 |
| - "ename": "SyntaxError", |
50 |
| - "evalue": "unterminated string literal (detected at line 4) (2231829726.py, line 4)", |
51 |
| - "output_type": "error", |
52 |
| - "traceback": [ |
53 |
| - "\u001b[0;36m Cell \u001b[0;32mIn[1], line 4\u001b[0;36m\u001b[0m\n\u001b[0;31m print(f\"A wind speed of {wind_speed_km} km/hr is {wind_speed_ms} m/s.)\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m unterminated string literal (detected at line 4)\n" |
54 |
| - ] |
55 |
| - } |
56 |
| - ], |
| 47 | + "outputs": [], |
57 | 48 | "source": [
|
58 | 49 | "wind_speed_km = 50\n",
|
59 | 50 | "wind_speed_ms = wind_speed_km * 1000 / 3600\n",
|
|
79 | 70 | },
|
80 | 71 | {
|
81 | 72 | "cell_type": "code",
|
82 |
| - "execution_count": 2, |
| 73 | + "execution_count": null, |
83 | 74 | "metadata": {
|
84 | 75 | "tags": [
|
85 | 76 | "raises-exception"
|
86 | 77 | ]
|
87 | 78 | },
|
88 |
| - "outputs": [ |
89 |
| - { |
90 |
| - "ename": "TypeError", |
91 |
| - "evalue": "unsupported operand type(s) for /: 'str' and 'int'", |
92 |
| - "output_type": "error", |
93 |
| - "traceback": [ |
94 |
| - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
95 |
| - "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", |
96 |
| - "Cell \u001b[0;32mIn[2], line 5\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m speed \u001b[38;5;241m*\u001b[39m \u001b[38;5;241m1000\u001b[39m \u001b[38;5;241m/\u001b[39m \u001b[38;5;241m3600\u001b[39m\n\u001b[1;32m 4\u001b[0m wind_speed_km \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m30\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[0;32m----> 5\u001b[0m wind_speed_ms \u001b[38;5;241m=\u001b[39m \u001b[43mconvert_wind_speed\u001b[49m\u001b[43m(\u001b[49m\u001b[43mwind_speed_km\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 7\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mA wind speed of \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mwind_speed_km\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m km/hr is \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mwind_speed_ms\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m m/s.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n", |
97 |
| - "Cell \u001b[0;32mIn[2], line 2\u001b[0m, in \u001b[0;36mconvert_wind_speed\u001b[0;34m(speed)\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mconvert_wind_speed\u001b[39m(speed):\n\u001b[0;32m----> 2\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mspeed\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m1000\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m/\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m3600\u001b[39;49m\n", |
98 |
| - "\u001b[0;31mTypeError\u001b[0m: unsupported operand type(s) for /: 'str' and 'int'" |
99 |
| - ] |
100 |
| - } |
101 |
| - ], |
| 79 | + "outputs": [], |
102 | 80 | "source": [
|
103 | 81 | "def convert_wind_speed(speed):\n",
|
104 | 82 | " return speed * 1000 / 3600\n",
|
|
139 | 117 | },
|
140 | 118 | {
|
141 | 119 | "cell_type": "code",
|
142 |
| - "execution_count": 3, |
| 120 | + "execution_count": null, |
143 | 121 | "metadata": {},
|
144 | 122 | "outputs": [],
|
145 | 123 | "source": [
|
|
148 | 126 | },
|
149 | 127 | {
|
150 | 128 | "cell_type": "code",
|
151 |
| - "execution_count": 4, |
| 129 | + "execution_count": null, |
152 | 130 | "metadata": {
|
153 | 131 | "tags": [
|
154 | 132 | "raises-exception"
|
155 | 133 | ]
|
156 | 134 | },
|
157 |
| - "outputs": [ |
158 |
| - { |
159 |
| - "ename": "IndexError", |
160 |
| - "evalue": "list index out of range", |
161 |
| - "output_type": "error", |
162 |
| - "traceback": [ |
163 |
| - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
164 |
| - "\u001b[0;31mIndexError\u001b[0m Traceback (most recent call last)", |
165 |
| - "Cell \u001b[0;32mIn[4], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mcities\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m5\u001b[39;49m\u001b[43m]\u001b[49m\n", |
166 |
| - "\u001b[0;31mIndexError\u001b[0m: list index out of range" |
167 |
| - ] |
168 |
| - } |
169 |
| - ], |
| 135 | + "outputs": [], |
170 | 136 | "source": [
|
171 | 137 | "cities[5]"
|
172 | 138 | ]
|
|
189 | 155 | },
|
190 | 156 | {
|
191 | 157 | "cell_type": "code",
|
192 |
| - "execution_count": 5, |
| 158 | + "execution_count": null, |
193 | 159 | "metadata": {
|
194 | 160 | "tags": [
|
195 | 161 | "raises-exception"
|
196 | 162 | ]
|
197 | 163 | },
|
198 |
| - "outputs": [ |
199 |
| - { |
200 |
| - "ename": "NameError", |
201 |
| - "evalue": "name 'stations' is not defined", |
202 |
| - "output_type": "error", |
203 |
| - "traceback": [ |
204 |
| - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
205 |
| - "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", |
206 |
| - "Cell \u001b[0;32mIn[5], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m station_id \u001b[38;5;241m=\u001b[39m \u001b[43mstations\u001b[49m[\u001b[38;5;241m1\u001b[39m]\n", |
207 |
| - "\u001b[0;31mNameError\u001b[0m: name 'stations' is not defined" |
208 |
| - ] |
209 |
| - } |
210 |
| - ], |
| 164 | + "outputs": [], |
211 | 165 | "source": [
|
212 | 166 | "station_id = stations[1]"
|
213 | 167 | ]
|
|
230 | 184 | },
|
231 | 185 | {
|
232 | 186 | "cell_type": "code",
|
233 |
| - "execution_count": 7, |
| 187 | + "execution_count": null, |
234 | 188 | "metadata": {
|
235 | 189 | "tags": [
|
236 | 190 | "raises-exception"
|
237 | 191 | ]
|
238 | 192 | },
|
239 |
| - "outputs": [ |
240 |
| - { |
241 |
| - "ename": "IndentationError", |
242 |
| - "evalue": "unindent does not match any outer indentation level (<tokenize>, line 3)", |
243 |
| - "output_type": "error", |
244 |
| - "traceback": [ |
245 |
| - "\u001b[0;36m File \u001b[0;32m<tokenize>:3\u001b[0;36m\u001b[0m\n\u001b[0;31m print(city)\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mIndentationError\u001b[0m\u001b[0;31m:\u001b[0m unindent does not match any outer indentation level\n" |
246 |
| - ] |
247 |
| - } |
248 |
| - ], |
| 193 | + "outputs": [], |
249 | 194 | "source": [
|
250 | 195 | "for city in cities:\n",
|
251 | 196 | " city = city + \" is a city in Europe\"\n",
|
|
254 | 199 | },
|
255 | 200 | {
|
256 | 201 | "cell_type": "code",
|
257 |
| - "execution_count": 8, |
| 202 | + "execution_count": null, |
258 | 203 | "metadata": {
|
259 | 204 | "tags": [
|
260 | 205 | "raises-exception"
|
261 | 206 | ]
|
262 | 207 | },
|
263 |
| - "outputs": [ |
264 |
| - { |
265 |
| - "ename": "IndentationError", |
266 |
| - "evalue": "expected an indented block after 'for' statement on line 1 (1297196788.py, line 2)", |
267 |
| - "output_type": "error", |
268 |
| - "traceback": [ |
269 |
| - "\u001b[0;36m Cell \u001b[0;32mIn[8], line 2\u001b[0;36m\u001b[0m\n\u001b[0;31m city = city + \" is a city in Europe\"\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mIndentationError\u001b[0m\u001b[0;31m:\u001b[0m expected an indented block after 'for' statement on line 1\n" |
270 |
| - ] |
271 |
| - } |
272 |
| - ], |
| 208 | + "outputs": [], |
273 | 209 | "source": [
|
274 | 210 | "for city in cities:\n",
|
275 | 211 | "city = city + \" is a city in Europe\"\n",
|
|
294 | 230 | },
|
295 | 231 | {
|
296 | 232 | "cell_type": "code",
|
297 |
| - "execution_count": 9, |
| 233 | + "execution_count": null, |
298 | 234 | "metadata": {
|
299 | 235 | "tags": [
|
300 | 236 | "raises-exception"
|
301 | 237 | ]
|
302 | 238 | },
|
303 |
| - "outputs": [ |
304 |
| - { |
305 |
| - "ename": "TypeError", |
306 |
| - "evalue": "unsupported operand type(s) for /: 'str' and 'int'", |
307 |
| - "output_type": "error", |
308 |
| - "traceback": [ |
309 |
| - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
310 |
| - "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", |
311 |
| - "Cell \u001b[0;32mIn[9], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mcities\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m/\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m5\u001b[39;49m\n", |
312 |
| - "\u001b[0;31mTypeError\u001b[0m: unsupported operand type(s) for /: 'str' and 'int'" |
313 |
| - ] |
314 |
| - } |
315 |
| - ], |
| 239 | + "outputs": [], |
316 | 240 | "source": [
|
317 | 241 | "cities[0] / 5"
|
318 | 242 | ]
|
|
0 commit comments