Executable cells in markdown#

Warning

This is just a test page for trying things out and debugging the Jupyter book…

This file adapted from this JupyterBook example.

print("A python cell")
A python cell

Try a simpler version:

print("A python cell")
A python cell

Try glue#

See https://jupyterbook.org/en/stable/content/executable/output-insert.html

from myst_nb import glue
my_variable = "here is some text!"
glue("cool_text", my_variable)
'here is some text!'

Now we can try to use this: ‘here is some text!’

Do it again, hiding the cell input and output:#

Now we can try to use this: ‘Here is the text printed in a hidden cell!’

Hide input with a button to show it#

See https://jupyterbook.org/en/stable/interactive/hiding.html

Hide code cell source

bignumber = 2**32
glue('bignumber',bignumber)

What power of 2 is this big number: 4294967296?

Hide code cell source

print(f'Hint, the 8th root of this number is {bignumber**(1/8):.0f}')
Hint, the 8th root of this number is 16