'Calculations in Markdown (Python, Jupyter Notebook)


I'm looking for solution to perform small calculations in text in Python Jupyter Notebook.

for example:
What to add in this sentence

The difference between sth and sth is 32-11. 

to have and effect

The difference between sth and sth is 21. 

I know that in R this would be:

The difference between sth and sth is `r 32-11`.


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source