Jupyter not displaying math correctly..a little help, please?

Hi. I just installed Anaconda, and I am trying to use Jupyter notebooks with a course I am following. I entered three simple math problems, one on each line, and it only gives me the answer for the last one when I run it. Does anybody know what is happening, or how to solve it? According to the course leader, all three sums are supposed to show… Thank you.

What version of the Jupyter tech are they using verse what you are using?

Aside of that we cannot help you unless you share more. Put the contents of each cell here as text code blocks, see here about ‘Block code formatting’. Then describe fully what you expect to see for each.

Only the last line of a cell is automatically displayed.

To display the previous lines, you must use the print function.

1 Like

Good thinking. Sometimes I forget the last line of the cell being special, by default, catches new learners.

Note that the setting can be changed though with a bit of code run at the top of the notebook, see here.
Some folks doing training like to use last_expr_or_assign as the setting for InteractiveShell.ast_node_interactivity, see this comment. Hopefully the trainer would make that obvious to learners.

1 Like