|
26 | 26 | "metadata": {}, |
27 | 27 | "source": [ |
28 | 28 | "## Printing out variables or displaying them in the debugger\n", |
29 | | - "This is probably the most common use for strings. You should (almost) always do some formatting/additional text to explain what you're printing out. These first examples just demonstrate using strings in print functions without much formatting.", |
30 | | - "\n", |
| 29 | + "This is probably the most common use for strings. You should (almost) always do some formatting/additional text to explain what you're printing out. These first examples just demonstrate using strings in print functions without much formatting.\n", |
31 | 30 | "TODO Edits to make/try\n", |
32 | 31 | "- change the order of prints\n", |
33 | 32 | "- add in some additional text (eg - print \"foo\" before printing a_string)" |
|
130 | 129 | "Yes, this syntax is weird. Think of it as calling the string function\n", |
131 | 130 | " **format(\"string to format var 1 (put first variable here) var 2 (put second variable here)\", first variable, second)**\n", |
132 | 131 | "\n", |
133 | | - "The curly brackets tell the format function to \"fill in\" the variables that are passed in. Python provides a much nicer way of doing this with **f(\"\")** which we'll show below. It's useful to see the more traditional, C++ or Matlab version first.", |
134 | | - "\n", |
| 132 | + "The curly brackets tell the format function to \"fill in\" the variables that are passed in. Python provides a much nicer way of doing this with **f(\"\")** which we'll show below. It's useful to see the more traditional, C++ or Matlab version first.\n", |
135 | 133 | "TODO edits to try/do\n", |
136 | 134 | " - add in a 3rd variable to pring\n", |
137 | 135 | " - print with 5 decimal places\n", |
|
265 | 263 | }, |
266 | 264 | { |
267 | 265 | "cell_type": "code", |
268 | | - "execution_count": 38, |
| 266 | + "execution_count": null, |
269 | 267 | "metadata": {}, |
270 | 268 | "outputs": [], |
271 | 269 | "source": [ |
|
507 | 505 | "name": "python", |
508 | 506 | "nbconvert_exporter": "python", |
509 | 507 | "pygments_lexer": "ipython3", |
510 | | - "version": "3.7.3" |
| 508 | + "version": "3.7.4" |
511 | 509 | } |
512 | 510 | }, |
513 | 511 | "nbformat": 4, |
|
0 commit comments