Usually code runs in your notebook because a cell is run. What if it is triggered by a user interface element instead? It might be a better discovery tool or a better method for rapid prototyping. This is what the ipywidgets library tries to enable
To be able to run the code in this video series you'll also need install and set up some extra tools. If you run the following code in the terminal you should be good to go.
pip install ipywidgets
jupyter nbextension enable --py widgetsnbextension
jupyter labextension install @jupyter-widgets/jupyterlab-manager