Book Review: Python Projects for Kids
Book Review: Python Projects for Kids
It may be well written, but it's hard to stand out in a crowded field of good books that cover Python for kids more thoroughly.
Join the DZone community and get the full member experience.Join For Free
I get asked by publishers to review books from time to time. Last month, Packt asked me if I’d be willing to review their book, Python Projects for Kids by Jessica Ingrassellino. Frankly, I tend to avoid beginning Python books now because they tend to be very similar, but I thought this one might be interesting.
- Why I picked it up: In this case, because Packt Publishing asked me to.
- Why I finished it: Mostly because Packt personnel badgered me to do so.
- I’d give it to: Not really sure. There are much better, more in-depth beginner books for Python out there.
You can get an eBook (PDF, EPUB or MOBI) version or a softcover.
This book only has 10 chapters and is 193 pages long.
First off, I didn’t actually read every single word in this book. I call this the skimming review method. Personally, I prefer to read a book at my own pace and review it accordingly, however, I have been asked repeatedly to finish this review so this is what you get. My first impression was that this book would teach youngsters how to program in Python by creating mini-games. However, we don’t really get into games until chapter 5. We don’t learn anything about pygame until chapter 8. Let’s go over each chapter and see what they’re about before I really dig in though.
Chapter one is your basic intro to what Python is and how to install it. The author chose to use Python 2.7 for this book over Python 3. The rest of the chapter is about creating a “Hello World” application and a work folder.
Chapter two is about variables and functions. This chapter is pretty brief, but I thought it covered the topics well enough. The biggest thing it does is explaining to the reader how to create a function and save it to a file.
For chapter three, we actually get to create a calculator of sorts. It’s text-based only and doesn’t really do anything to handle bad inputs from the user. In fact, one big knock against this book is that it doesn’t talk about exception handling at all. I also have a couple of problems with this chapter. I believe that page 34 is showing the wrong screenshot as the accompanying text is talking about casting from one type to another while the screenshot doesn’t show any kind of casting whatsoever. The other issue is that on page 41, the text states that you can run the script as written in the book. However I don’t see anything in the code that actually calls any of the functions, so if you run this code, you will get nothing outputted to the terminal.
Chapter four is all about conditional statements and loops. The purpose of this chapter is to enhance the calculator application you wrote in the previous chapter such that it keeps running until the user asks it to quit.
In chapter five, we learn how to create easy and hard levels for our game. The game is the “Higher or Lower” game. You will learn about what a Boolean is, how to import a library, and global variables.
Chapter six dives into some of Python’s more interesting data types, the list and dictionary. The premise of this chapter is to teach the reader how to store data. While I agree that lists and dictionaries are a good format, I wonder if learning about pickle, JSON, or YAML might have been good to learn about here too. Admittedly, I don’t think this book talks about File I/O, so those topics are probably considered to be out of scope.
For chapter seven, the reader learns how to create a two player game that the author dubs “What’s in Your Backpack?” This chapter helps the reader layout a game that can keep score, restart the game, or stop the game. You will also learn how to create a player profile, which is formatted as a dict. This seems like a good place to use a class to me, especially if we’re going to be using pygame in the next chapter, but I realize the target audience is supposed to be kids. Anyway, you will also get to add items to a virtual backpack, which is kind of fun to learn the author’s implementation.
We finally reach pygame in chapter eight where you learn how to install pygame. You will also learn how to set up the screen size and color as well as create stationary and moving objects.
Chapter nine builds on chapter eight by teaching the reader how to create a tennis game (i.e. pong). It introduces the reader to the concepts of game programming and how to outline your project before coding it. This chapter is actually split into four sections after this point. The first section basically creates all the pieces of the game that you will need. Section two will teach you how to move the paddles and section three will teach you how to move the ball. Section four is about how to run the game and keep score.
The final chapter encourages the readers to keep coding! The text tells its readers where to go from here. For example, it talks about how they will need to learn about classes and objects to promote code reuse. It also mentions that you can add music and graphics with pygame. Then it talks about redesigning your game or trying to create your own versions of classic games. Finally, it talks about other uses and libraries for Python, such as SciPy, iPython, and MatPlotLib.
When I first heard about this book, I immediately thought of Jason Briggs’ book, Python for Kids and the Sande’s book, Hello World!: Computer Programming for Kids and Other Beginners. Both of these books are longer and contain a lot more information than “Python Projects for Kids” does. I personally think that of the three, I would choose the Sande book as the easiest for kids to get into. Briggs covers a lot more interesting topics, but he may go just a tad too fast depending on the child. As for “Python Projects for Kids”, I feel like there are too many items that aren’t covered (classes, exceptions, many Python data constructs, etc). It also feels like pygame itself isn’t really covered. There seemed to be a big build up to get to pygame and then there just wasn’t much content when we finally got there.
If I were to lay out a strategy for learning Python for children, I would start with Sande and then if the child wanted to learn about games, I would move on to Sweigart’s books on creating games with Python (Invent Your Own Computer Games with Python and Making Games with Python & Pygame.) Then I might move onto something else, like some of the Python for Minecraft books.
As for this book, I just don’t know where it would fit. I believe it was written well but needed some additional polish to push to the top of the heap.
Published at DZone with permission of Mike Driscoll , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.