Ask Your Question

Revision history [back]

To display code in a Markdown cell in Jupyter, use single backticks for inline code, triple backticks for code blocks.

For example:

In the next cell we will define `square` by

```
def square(x):
    return x * x
```

will render as

In the next cell we will define square by

def square(x):
    return x * x

Some Jupyter Notebook and JupyterLab extensions allow to evaluate code in a Mardown cell in Jupyter. See: