Home Review of the book - "A Smarter Way To Learn Python"
Post
Cancel

Review of the book - "A Smarter Way To Learn Python"

If you are keen to learn programming, there are multiple learning paths available, as well as various tools that can be used in that regard. Regardless of your previous education and knowledge that you may possess, there is a myriad of dedicated learning websites, courses, mentorships, tuitions and books. In this article, we’ll assume that you are newbie with no programming experience interested in Python and wanting to learn from the book.

A Smarter Way To Learn Python

“A Smarter Way To Learn Python” is an introductory Python book, comprehensible to the total beginners with no previous experience in the field whatsoever. It can be used by more seasoned programmers too as a quick reference to some simpler topics. The concept author used in the book is a presentation of various topics in the form of lessons followed by numerous online exercises that should solidify the obtained knowledge.

A Smarter Way To Learn Python

Contents

In total, there are 77 lessons or chapters as the author calls them, which could be grouped into following segments:

  • introductory topics (14 chapters), including variables, basic expressions and if statements,
  • data structures and miscellaneous related stuff, which can be further subdivided to lists (5 chapters); tuples (1 chapter); dictionaries (16 chapters); for loops (2 chapters); while loops (2 chapters),
  • functions (10 chapters),
  • classes and OOP (9 chapters),
  • working with external data (15 chapters), including CSV and JSON files,
  • debugging and general information topics (3 chapters).

In addition, through 5 appendixes, some preparatory topics like Python installation, running and saving programs are explained too.

The book comes under 240 pages and it can be quickly consumed, depending on one’s particular workload, in probably 2 weeks time together with the included exercises.

What will you learn from the book are the basic concepts; you will get information about how things as done, such as taking input from user, concantenating variables, grouping code via functions and classes etc., especially in a syntactical regard. Presented information is a bare minimum to get started with the programming in Python. The explanations are sufficient to get a grasp on how things may be done. Yet, as one progresses, the questions will inevitably arise, as the book follows linear learning pattern and it does not discuss much out of the lesson’s scope. For instance, the reader may ask himself why use CSV when there is a dictionary and vice versa; could the OOP be replaced and/or supplemented with functions; and finally; what could one do with the obtained knowledge presented in the book. While it is understandable that it is impossible to dive into any deeper discussion in such a brief book, there is complete absence of any advices and recommendations when further learning path is concerned. Yet, many other programming books also fail in this domain.

Examples of the exercises

There are no projects in this book, which is also to expect. Instead, through the exercises after the each lesson, the user is pointed to the book’s accompanying website. There are numerous quiz-like exercises where user can type simpler commands and the page checks its validity. There are no review exercises so every exercise is mapped to the particular chapter in the book. Some examples of the questions are, taken in a random order:

  • What is the keyword for adding a new element to the end of a list?

  • Eliminate the element with an index of 2 from a list whose name is products.

  • Rewrite this so you can make changes to the elements.

      sizes = ("sm", "med", "lg", "xl")
    
  • Targeting the correct element in the following list, assign “fi” to the variable giant_syllable.

      giant_speak = ["fee", "fi", "fo", "fum"]
    
  • Delete a dictionary item whose key is an integer. Make everything up.

  • In the following code, what is the value of total if the function call doesn’t pass any arguments?

      def add_numbers(first_number = 2, second_number = 4):
      total = first_number + second_number
    
  • This is the first line of a function definition. When optional arguments are passed, they’re assigned to x, which is a ____.
      def fill_dictionary(new_customer, first_name, last_name, **x):
    
  • Code the first two lines of a function. Line 2 begins the definition of a class. Make everything up.

  • Create an instance of this class. The name of the instance is geneva. The value is 144.

      class Lake():
      def __init__(self, depth):
          self.depth = depth
    
  • Complete the fourth line.

      1 with open("cats.csv") as f:
      2   cat_content = csv.reader(f)
      3   cats_list = []
      4   for each_line in ___________
    

In the end, after the book’s completion the reader will have a fair comprehension of basic Python’s features. From that point there are two possible learning paths:

  1. The user may continue to consume similar material, which puts emphasize on the syntax rather on underlying logic. That can lead to

  2. After this book, more advanced material may be consulted, which will provide answers not only to how, but to why as well. This route is longer and harder but it enables understanding of the fundamentals of programming which are not related to just one programming language.

Conclusion

The “Smarter Way To Learn Python” is a decent read, which will fairly quickly put a complete beginner into a position of understanding basic concepts of coding in Python, and as such is worth of studying.

This post is licensed under CC BY 4.0 by the author.