Teaching programming in the Notebook with IPython Blocks
The Jupyter Notebook is not only a tool for scientific research and data analysis but also a great tool for teaching. In this recipe, we show a simple and fun Python library for teaching programming notions: IPython Blocks (available at http://ipythonblocks.org). This library allows you or your students to create grids of colorful blocks. You can change the color and size of individual blocks, and you can even animate your grids. There are many basic technical notions you can illustrate with this tool. The visual aspect of this tool makes the learning process more effective and engaging.
In this recipe, we will notably perform the following tasks:
- Illustrate matrix multiplication with an animation
- Display an image as a block grid
Getting ready
To install IPython Blocks, type pip install ipythonblocks
in a Terminal.
How to do it...
- First, we import some modules as follows:
>>> import time from IPython.display import clear_output...