Most of the code in the fast.ai material is presented in the form of Jupyter Notebooks. These are a mix between runnable code and anything that isn't: embedded images, descriptions, links.
By being able to include both texts and images (or videos) as well as live code, Jupyter Notebooks are well suitable to a learning environment, where both code and explanation is necessary.
Additionally, Jupyter Notebooks allow you to execute code by blocks, and to re-run blocks as often as you want. In that way, they are an effective way to interact with the lecture material, and immediately experiment and get feedback.
Not only are they useful in learning environments, but they also find widespread use in the ML industry. Machine Learning is a very exploratory field, in that the constraints and particularities of a problem are rarely well defined. Oftentimes the data has to be explored and visualized, different approaches have to be tried out, parameters tuned, until a valid solution is found. It is a very iterative process. Jupyter notebooks and their interactive code blocks are perfect for this.
Jupyter Notebooks can be hosted and run either locally, or on the cloud. Cloud platforms like Google Colab or Kaggle Notebooks take care of the setup, but if you wish to run them locally you can follow this installation guide.