Errata

The following is errata found in the original paperback version of the book. They may also appear in the Amazon edition. The eBooks that are bought through Gumroad will be updated the quickest, followed by the Amazon edition.

Chapter 3 (lists, tuples, dictionaries)

  • Page 23 – In the dictionary section, I discovered that I had referred to the keys method as returning a list. In Python 3, it actually returns a view. See the documentation for additional information

Chapter 5 (loops)

  • Page 31 – This page demonstrates how to loop over a dictionary’s keys. There’s a part where I sort the keys. The sorting method (sort) is incorrect. Instead of keys.sort(), it should be sorted(keys)
  • The examples that show Python’s range function is incorrect. It should return a range object in Python 3 vs a Python list in Python 2.

Chapter 8

  • Page 44-45 mentions that you can read a byte at a time from a file. It should have said kilobyte as a kilobyte is 1024 bytes or characters, which is what was mentioned in the “read a file in chunks” section.

Chapter 13

  • The first example of reading a csv file is opening the file in “rb” mode when it should be just opening it in “r” (i.e. read-only) mode.