|
166 | 166 | " return [i ** 2 for i in range(1, n + 1)]\n", |
167 | 167 | " ### END SOLUTION\n", |
168 | 168 | "\n", |
169 | | - "exercise_description = \"\"\"\n", |
| 169 | + "description = \"\"\"\n", |
170 | 170 | "Write a function that returns a list of numbers,\n", |
171 | 171 | "such that $x_i=i^2$, for $1\\leq i \\leq n$.\n", |
172 | 172 | "Make sure it handles the case where $n<1$ by raising a `ValueError`.\n", |
|
179 | 179 | " check_registry=check_registry,\n", |
180 | 180 | " exercise_registry=exercise_registry,\n", |
181 | 181 | " key=\"Part A (2 points)\",\n", |
182 | | - " description=exercise_description\n", |
| 182 | + " description=description\n", |
183 | 183 | ")\n", |
184 | 184 | "\n", |
185 | 185 | "# Check that squares returns the correct output for several inputs\n", |
|
286 | 286 | " return sum(squares(n))\n", |
287 | 287 | " ### END SOLUTION\n", |
288 | 288 | "\n", |
289 | | - "exercise_description = \"\"\"\n", |
| 289 | + "description = \"\"\"\n", |
290 | 290 | "Using your `squares` function, write a function\n", |
291 | 291 | "that computes the sum of the squares of the numbers\n", |
292 | 292 | "from 1 to $n$. Your function should call the `squares`\n", |
|
300 | 300 | " check_registry=check_registry,\n", |
301 | 301 | " exercise_registry=exercise_registry,\n", |
302 | 302 | " key=\"Part B (1 point)\",\n", |
303 | | - " description=exercise_description\n", |
| 303 | + " description=description\n", |
304 | 304 | ")\n", |
305 | 305 | "\n", |
306 | 306 | "# Check that sum_of_squares returns the correct answer for various inputs\n", |
|
402 | 402 | "### END SOLUTION\n", |
403 | 403 | "\"\"\"\n", |
404 | 404 | "\n", |
405 | | - "exercise_description = \"\"\"\n", |
| 405 | + "description = \"\"\"\n", |
406 | 406 | "Using LaTeX math notation, write out the equation\n", |
407 | 407 | "that is implemented by your `sum_of_squares` function.\"\"\"\n", |
408 | 408 | "\n", |
409 | 409 | "text_ex = TextExercise(\n", |
410 | 410 | " value=value,\n", |
411 | 411 | " exercise_registry=exercise_registry,\n", |
412 | 412 | " key=\"Part C (1 point)\",\n", |
413 | | - " description=exercise_description\n", |
| 413 | + " description=description\n", |
414 | 414 | ")\n", |
415 | 415 | "text_ex" |
416 | 416 | ] |
|
459 | 459 | " ### BEGIN SOLUTION\n", |
460 | 460 | " ### END SOLUTION\n", |
461 | 461 | "\n", |
462 | | - "exercise_description = \"\"\"\n", |
| 462 | + "description = \"\"\"\n", |
463 | 463 | "Find a usecase for your `sum_of_squares` function and implement that usecase in the cell below.\n", |
464 | 464 | "\"\"\"\n", |
465 | 465 | "\n", |
|
469 | 469 | " update=lambda code_ex: print(code_ex.code(code_ex.parameters['n'])),\n", |
470 | 470 | " exercise_registry=exercise_registry,\n", |
471 | 471 | " key=\"Part D (2 points)\",\n", |
472 | | - " description=exercise_description\n", |
| 472 | + " description=description\n", |
473 | 473 | ")\n", |
474 | 474 | "\n", |
475 | 475 | "code_ex_pyramidal_number" |
|
513 | 513 | }, |
514 | 514 | "outputs": [], |
515 | 515 | "source": [ |
516 | | - "exercise_description = \"\"\"\n", |
| 516 | + "description = \"\"\"\n", |
517 | 517 | "State the formulae for an arithmetic and geometric\n", |
518 | 518 | "sum and verify them numerically for an example of\n", |
519 | 519 | "your choice.\"\"\"\n", |
|
525 | 525 | "\"\"\",\n", |
526 | 526 | " exercise_registry=exercise_registry,\n", |
527 | 527 | " key=\"Part E (4 points)\",\n", |
528 | | - " description=exercise_description\n", |
| 528 | + " description=description\n", |
529 | 529 | ")\n", |
530 | 530 | "\n", |
531 | 531 | "text_ex" |
|
0 commit comments