visit
Learn Python through Nursery Rhymes and Fairy Tales is my upcoming book currently available for pre-order on Kickstarter.
This is how I first thought of the idea for a colorful picture book that told a story with code, in which real-life situations are described in computer programs. I wanted to create a fun, relatable alternative to the existing textbook-like options for beginner programming books. I was also motivated to create an easy-to-read book that teaches concepts quickly and concisely solely through complete code examples and their explanations. My first book A Day in Code tells a story about a fun day that describes situations with C programs next to full-page illustrations that depict the scenes being described. My recently released book A Day in Code- Python teaches Python basics in the same way. It has a castles and dragons theme, which led me to another idea…
Nursery rhymes and fairy tales have been translated into over a hundred languages, but never a computer programming language…until now. My upcoming book resembles a traditional fairy tale storybook, but with a very modern twist- the nursery rhymes and fairy tales are written as complete Python programs! My intention is that the reader’s instant familiarity and emotional connection to the classic stories will make the Python programs easier to understand and enjoyable to read.
Each nursery rhyme/fairy tale program demonstrates one or more new Python concepts. The code is explained below each program. Each nursery rhyme consists of a single page Python program and the fairy tales are split up into multiple pages each containing a complete Python program. When each program is run on your computer, it outputs the nursery rhyme/fairy tale with print
functions.
This code page describes the end of Goldilocks and the Three Bears:
This is the accompanying illustration:
Who knew that classic nursery rhymes and fairy tales from hundreds of years ago are structured in a way that makes them transfer well into good code examples? Translating the stories into Python felt as if they were designed to be written in code. It was fun to view them from a logical standpoint and break them down into code. Goldilocks and the Three Bears turned out to be mostly a series of if/else
statements. Other nursery rhymes and fairy tales were well-suited to be “translated” into functions and classes.
Check out my upcoming book Learn Python through Nursery Rhymes and Fairy Tales on .