Answer a question

Can I print the value of a variable in Markdown Cell Jupyter Notebook?

Tried Code:

value = 5.3

Markdown cell --> Value is {{ value }} 

I want that the Markdown cell should display the value of variable

SCREENSHOT

Screenshot for Code

Answers

So After going through all the links I was able to resolve the problem by referring to nbextension jupyter notebook docs : https://github.com/ipython-contrib/jupyter_contrib_nbextensions

Steps Taken:

  1. pip install jupyter_contrib_nbextensions
  2. jupyter contrib nbextension install --user
  3. jupyter nbextension enable python-markdown/main

After the above commands started a jupyter notebook and to print the value of a variable in the markdown cells works like charm!

You just have to use {{ ac_score }} within a markdown cell.

Screenshot

enter image description here

Thanks!

Logo

Python社区为您提供最前沿的新闻资讯和知识内容

更多推荐