@@ -524,7 +524,10 @@ If you can, add a legend, to help distinguish between the three time series.
|
524 | 524 | Hints: |
525 | 525 | |
526 | 526 | * If you call the `plot()` function multiple times before calling `show()`, all of the lines you produce will end up on the same figure. |
527 | | -* For the legend, noted that the expression `'foo' + str(42)` evaluates to `'foo42'`. |
| 527 | +* For the legend, noted that if `var = 42`, the expression `f'foo{var}'` evaluates to `'foo42'`. |
| 528 | + |
| 529 | + Note: `f'foo{var}'` is an example of [f-String](https://docs.python.org/3/tutorial/inputoutput.html#tut-f-strings), which allows you to use `{}` to contain an expression. The contained expression will be evaluated, and the result will be placed into the string. |
| 530 | + |
528 | 531 | ``` |
529 | 532 | |
530 | 533 | ```{exercise-end} |
@@ -550,11 +553,6 @@ plt.legend()
|
550 | 553 | plt.show() |
551 | 554 | ``` |
552 | 555 | |
553 | | -Note: `f'$\\alpha = {α}$'` in the solution is an application of [f-String](https://docs.python.org/3/tutorial/inputoutput.html#tut-f-strings), which allows you to use `{}` to contain an expression. |
554 | | - |
555 | | -The contained expression will be evaluated, and the result will be placed into the string. |
556 | | - |
557 | | - |
558 | 556 | ```{solution-end} |
559 | 557 | ``` |
560 | 558 | |
|