Sams Teach Yourself Python in 24 Hours by Katie Cunningham is a book for aspiring Python developers. Note that this is a review of the fifth printing of the book (September 2015) using Python 2.7 as its base!
To start, the first sections of the book cover how to install Python and how to navigate the command-line, which is great for the inexperienced programmer. The middle sections include topics such as functions, classes, dictionaries, and documentation. The latter part of the book discusses various Python modules and the broader view of programming.
The book consists of 24 sections with each section having descriptions, example code, tips, quizzes, and exercises. The author, Katie Cunningham, claims that each section of the book can be completed in one hour or less. From my experience, it took me an average of about two hours to complete each section. This increase in time occurred because I took extra steps to ensure I understood the material. I briefly outline this process below.
I used three different methods as I went through each section. First, I would read the whole section and do my best to understand the material being discussed. Second, I would go through the section again, but this time taking notes. Finally, I would go through the section once more and code all the examples and exercises on my computer. By doing this for each section, I was better able to grasp the concepts in this book.
Each section starts with a summary stating what will be covered. Cunningham then provides a layman’s terms description of the main topic. After this introduction, she walks through the topic step-by-step, going into more detail as you walk. At the end of each section, there is a summary, Q&A, quiz (with answers), and exercise for you to test your knowledge.
What is interesting is that most of the sections include a subsection titled, “Using _ in the Real World” (where the blank is the section’s topic). It is here that Cunningham uses real-world examples to contextualize the information. For example, she explains how a waitress can create a receipt program using classes and methods. As you continue through the sections, you implement what you’ve learned into the waitresses’ receipt program thereby making it more robust.
As stated before, the first and middle parts of the book cover the basics of Python. The latter part of the book introduces the modules, frameworks, and libraries random, datetime, JSON, SQLite, Flask, and Pygame. This is great as the reader gets a taste of what Python can do outside the basics of the language. The book also covers versioning with Git and Github, and provides resources to learn more about the topics discussed in the book.
As I worked through the book, I came across vague descriptions. This isn’t too bad as one can find more descriptive explanations online. However, I also found about a dozen mistakes in the example code. There have been a few times where I could not figure out what was happening in the examples. For example in Hour 17: Sharing Information with JSON (page 193), there is a function called ‘save_receipt(total)’ and the parameter ‘total’ is not used. What I found out is that in the lower half of the function, the variable named ‘grand_total’ is in the spot of the variable named ‘total.’
The book covers what you would expect from a book aimed at aspiring programmers. Despite the fact that it took me longer than 24 hours to finish the book, I believe that it is possible for a beginning Python programmer to finish the book within thirty hours (if you include doing all the reading, examples, and exercises).
As for content, the author did a good job covering the basics of Python. It’s great to see that she attempted to contextualize the topics covered. Some of the example explanations can be confusing and there are mistakes in the example code to watch out for.
Overall, I would recommend this book to a beginning programmer who wants to know more about Python. However, I would not recommend this book to the absolute beginner.
I hope this review helps you in some way. If you have any questions, additions, or critiques of your own, feel free to leave a comment below.