Errata

Head First Learn to Code

Errata for Head First Learn to Code

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
PDF Page xx
TOC Item #9

"Now let’s look at that request module again"
change "request" to "requests" (plural)

Jørgen Lang  Apr 18, 2018 
Printed Page pp 26--27
figures

on page xxxiv, "Do not download version 2.7.", but figures of pp 26 -27are made by version 2.7.9.

Yukitoshi Fujimura  Oct 09, 2018 
Printed Page 48
1st annotation

"The highest precedence in this expression is exponentiation. 3 is 9^2."

It should be:

"The highest precedence in this expression is exponentiation. 3^2 is 9."

Eleonora Pinto de Moura  Mar 16, 2018 
Printed Page 48
2/3 down the page

Next to the the expression 3 / (1 + 2) * 3 ** 2

It says "The highest precedence in this ..."
This is wrong!
It should read: "The second highest precedence ..."

The next sentence says: "Next we have to take care of the addition in parens ..."
This is wrong!
It should read: "First we have to take care ..."

At the top of this page the concept of PEMDAS is explained and then you present this example that is wrong.

I sent the author an e-mail explaining this mistake several months ago but the correction is still not listed.

George Schultz  Sep 22, 2018 
Printed Page 61
on the cup labeled dog_age

If we are using the code in the Test Drive on page 60, then the cup labeled dog_age stores the string '12' not the number 12.

Eleonora Pinto de Moura  Mar 16, 2018 
Printed Page 67
Sharpen your pencil Solution, 2nd item

"We'll also need to save this somewhere so we can use it in step 4."

Since the dog's age is used in step 3, it should be:
"We'll also need to save this somewhere so we can use it in step 3."

Eleonora Pinto de Moura  Mar 16, 2018 
Printed Page 70
2nd Solution

The solution given is the following:

dog_name = input("What is your dog's name? ")
dog_age = int(input("What is your dog's age? "))
human_age = int(dog_age) * 7
print(human_age)

Given the annotation of this solution, it should be:

dog_name = input("What is your dog's name? ")
dog_age = input("What is your dog's age? ")
human_age = int(dog_age) * 7
print(human_age)

Eleonora Pinto de Moura  Mar 16, 2018 
PDF Page 93
Top right box, serious coding

Wondering about precedence with Boolean operators? The relational operators (>, <,==, and so on) are highest,followed by not, or, and then and.

The Priority is not, and and then or!

Spike Py  Jan 27, 2020 
Printed Page 97
Last line of the code

The code written is:

print(winner, 'won. The computer chose', computer_choice + '.'

But the second parentheses is missing. So it should be:

print(winner, 'won. The computer chose', computer_choice + '.')

Eleonora Pinto de Moura  Mar 16, 2018 
112-113
Paragraph before BULLET POINTS

You’ve create some logic that never lets the loop end,

Should be:
You’ve created some logic that never lets the loop end,

Anonymous  Mar 26, 2020 
Printed Page 115
Across clue list of the crossword

There is no clue for the word 23 across.

Eleonora Pinto de Moura  Mar 16, 2018 
Printed Page 123
Solution for the 1st down word

The answer is "Ferrari" not "Ferarri".

With the right solution in item 1 down, we cannot fit the 4th word across "comparison".

Eleonora Pinto de Moura  Mar 16, 2018 
PDF Page 129
last paragraph

Original: "[…] the smoothie list will look like this:"

Does "smoothis list" refer to the variable name of the list? If so, "smoothie" should be changed to "smoothies" and formatted as code for clarity.

Jørgen Lang  Mar 15, 2018 
PDF Page 130
heading, description 2nd sentence

Description says, "Pretend you're the Python Interpreter…".
Maybe the "BE the Interpreter" template should be used here.

Jørgen Lang  Mar 15, 2018 
PDF Page 143
annotation below 1st para

Original: "Next, ‘strawberry’ is then assigned to the smoothies variable."

should be the singular variable:

"Next, ‘strawberry’ is then assigned to the smoothie variable."

Jørgen Lang  Feb 23, 2018 
PDF Page 145
bottom annotation

Original: "Each time we iterate, we print “Smoothie#", the index, and the smoothie at that index."

Missing space before "#".

Jørgen Lang  Mar 15, 2018 
Printed Page 161
Last line of the Python Shell

Missing a space before 18. It should be:

Solutions with highest score: [11, 18]

Eleonora Pinto de Moura  Apr 06, 2018 
PDF Page 162
1st code comment below paragraph

Original: "Scores and costs are parallel lists"
Since it's a variable name, "scores" should be lowercase.

Jørgen Lang  Mar 16, 2018 
PDF Page 167
code example, annotations on the left, 2nd annotation

Change 'cost list' to 'costs list'. (cost holds a single value)

Original: "And we use each best_solutions item as an index into the cost list."

Should be: "And we use each best_solutions item as an index into the costs list."

Jørgen Lang  Mar 03, 2018 
Printed Page 167
code example

The code written is:

print('Solution', most_effective, 'is the most effctive with a cost of', costs[most_effective])

But the second effective is missing an "e". So it should be:

print('Solution', most_effective, 'is the most effective with a cost of', costs[most_effective])

Eleonora Pinto de Moura  Apr 06, 2018 
Printed Page 169
Crosswords's tips

#Portuguese printed version (I don't know if it has the same error in other language)

Tip "14 - vertical" should be "17 - horizontal" to fit correctly (according to the solution on page 178)

Tip "17 - horizontal" should be "4 - vertical" to fit correctly (according to the solution on page 178)

It is missing the tip for "14 - vertical" (according to the solution on page 178)

Arthur Garcia  Jun 15, 2021 
PDF Page 176
1st pararaph, 1st sentence

replace "previous page" with "page 153" (PDF) to establish a correct back-reference

Jørgen Lang  Mar 04, 2018 
PDF Page 177
Top "Sharpen" solution, 1st annotation, 1st sentence

Original:
This syntax creates a list with ‘secret' as an item repeated five times: [‘secret', ‘secret', ‘secret', ‘secret', ‘secret'].

Gives: SyntaxError: invalid character in identifier

Change to:
This syntax creates a list with ‘secret' as an item repeated five times: ['secret', 'secret', 'secret', 'secret', 'secret'].

Works as expected.

Elements in list are not quoted correctly. They use 'left single quotes' (‘) instead of apostrophes (') necessary in code as the left delimiter. This could lead to errors when code is being copied/pasted directly from the PDF. Subtle but possibly fatal.

Jørgen Lang  Mar 04, 2018 
PDF Page 177
2nd "Sharpen" solution, 2nd sentence, rightmost annotation

Intro text says "You’ll find all the code up until now listed below." while annotation says "We're just showing you the new code."

Annotation is correct. Suggestion to change intro text to "You'll find our solution below."

Jørgen Lang  Mar 04, 2018 
PDF Page 190
1st pararaph, last sentence

“WOOF WOOF" and "woof woof” should probably be formatted as literal text or surrounded by quotes.

Jørgen Lang  Mar 05, 2018 
PDF Page 210
bottom code annotation

Original: "And if we supply an argument for message, then our greet function will gladly accept that as the message argument."

Suggestion: "…will gladly accept that as a value for the message parameter."

Jørgen Lang  Mar 07, 2018 
PDF Page 212
1st code example, annotation on the right, last sentence

Original: "Just make sure your calls provide any required arguments before the keywords arguments."

"keywords" should IMHO be singular.

Jørgen Lang  Mar 07, 2018 
Printed Page 216
5th tip on the right column

*Portuguese printed version*

Bullet points:

In the right column, the 5th tip says "Parameters of a function are treated as global variables in the body of a function."

It should say "Parameters of a function are treated as local variables in the body of a function."

Did I confuse or I'm correct?

Arthur Garcia  Jun 18, 2021 
PDF Page 229
4th paragraph

Original: "Moving on, we compare the 3rd and 4th index values, and the 4th value is larger, so we do not need to swap."

In fact, the 4th (index 3, value 6) and 5th (index 4, value 9) value are being compared in this step. To avoid confusion I'd recommend to stick with index numbers here.

Option 1: "Moving on, we compare the values of index 3 and 4, and value of index 4 is larger, so we do not need to swap."

Option 2: Moving on, we compare the 4rd and 5th index values, and the 5th value is larger, so we do not need to swap.

Jørgen Lang  Mar 07, 2018 
PDF Page 229
2nd paragraph

Original: "[…] the index 2 value is larger than index 3 […]"
Should be: "[…] the index 2 value is larger than index 1 […]"

Jørgen Lang  Mar 07, 2018 
PDF Page 236
4th code annotation from bottom

Original: "...except, when we swap two values of the score list […]"
Change to: "...except, when we swap two values of the scores list […]"

Jørgen Lang  Mar 08, 2018 
PDF Page 238
“Nice job"-text, last paragraph

Original: "You’ve got a brain twister ahead, and the bullet points and the crossword..."

There is no crossword in chapter 4b.

Jørgen Lang  Mar 08, 2018 
PDF Page 241
1st para, 2nd sentence

Original: "Take the list below and bubble sort it, showing your work just like we did on the previous two pages."

Change "the previous two" to "pages 228 and 229." for correct context.

Jørgen Lang  Mar 07, 2018 
PDF Page 242
1st para, last sentence

Original: "After you’ve done the exercises, look at the end of the chapter to see if you got it right."

Update: "Here are our solutions."

Jørgen Lang  Mar 08, 2018 
Printed Page 242
Python Shell window with the first output

*Portuguese printed version*

The first Python Shell window shows de output for the code, but it is missing the number 9 in the end, which is the result of 3 * 3.

Arthur Garcia  Jun 22, 2021 
PDF Page 249
IF...ELIF... pseudocode

variable score is defined, and used in the IF...ELIF pseudocode section. It is used correctly in the IF portion of the code, but for all the ELIFs, it is listed as scores , a plural of the variable name. This of course will not work properly, and since scores is undefined, will result in NameError.

Correct all occurrences of scores to score

Steve Lamb  Jan 02, 2019 
PDF Page 253
test drive, 2nd sentence

Original: "[…] to your analyze file."
Missing formatting and file extension:

"[…] to your <literal>analyze.py</literal> file."

Jørgen Lang  Mar 12, 2018 
PDF Page 273
1st para

Original: "Or, likewise, if you omit the ending index, then slice assumes you mean to stop the end of the list:"

1. format "slice" as literal/code
2. replace "list" with "string". Usage of slice for lists is being introduced at bottom of page, but not yet.

Jørgen Lang  Mar 13, 2018 
PDF Page 322
page 322, page 324ff, object illustrations, bottom half of page

Introduced turtle colors are: red, pink, cyan, orange, and gray. This corresponds to the illustration on page 322.

Throughout the remainder of the chapter the colors 'blue', 'red', 'purple', 'brown', 'green' are used.

IMHO, the easiest fix is to replace the illustration on page 322 and change the text on the 'objects' on page 324 to correspond with the rest of the chapter.

Jørgen Lang  Mar 21, 2018 
PDF Page 324
page left, object diagram

shape() was introduced as a method on page 316/317, ist now (on page 324) an attribute. Is being used as a method only throughout the rest of the chapter.

Suggestion: Only use it as a method to avoid confusion. This would also correspond with page 319 where access to attributes via getter/setter methods is being explained.

Jørgen Lang  Mar 21, 2018 
PDF Page 328
bottom of page (2A)

sentence = "To do that we simply use a for/in statement over our global turtles lists."

sentence.replace("lists", "list")

Jørgen Lang  Mar 22, 2018 
Printed Page 335
Crosswords's tips

**Portuguese printed version**

The crosswords doens't match the tips shown in the page.

If you check the crosswords' solution on page 339, this is the correct one.

Arthur Garcia  Jul 13, 2021 
PDF Page 336
first code annotation, top right of page

Original: "Notice we can pass any turtle into make_square, not just slow_poke."

Change "slow_poke" to "slowpoke".

Jørgen Lang  Mar 20, 2018 
PDF Page 377
code example, 5th annotation, 2nd sentence

Original: "Remember in Python a dictionary key can be any value, including integers."

IMHO this is misleading/confusing for two reasons:

1. a key and a value are different things, esp. in the context of dictionaries.

2. *any* value (or type)
Not absolutely sure here. Can a list be used as a dictionary key? I don't think so (hashing issues, AFAIK). See e.g. https://wiki.python.org/moin/DictionaryKeys

Page 363 (PDF) says: "For keys you can use numbers, strings, or Booleans. For dictionary values you can use any valid Python value."

Suggestion: Rephrase to: "Remember in Python many data types can be used as dictionary keys, including integers."

Jørgen Lang  Mar 28, 2018 
PDF Page 403
code annotation bottom left

"Let’s use the read method to get the entire contents of the lib file..."
-> "[…] lib.txt file...

Jørgen Lang  Apr 02, 2018 
PDF Page 407
1st code example

Example shows text with \n sequences, but placeholders are highlighted in bold. Suggestion to highlight \n instead.

Jørgen Lang  Apr 03, 2018 
PDF Page 411
Comment to the right of placeholders

As I understand it, global variables are visible throughout the code, including inside functions. Doesn't matter if you reference it, as a read, in 10 different functions - it will be readable. The only time this is a problem is if you want to write to that global and change it's value(s). THAT is when you need to use the global keyword. At least, that is how I interpreted your definition of the global keyword.

So IS it really necessary to add the 'global placeholder' code in the 'process_line' function? Did I misunderstand your intent?

Steve Lamb  Jan 05, 2019 
PDF Page 411
Possible alternate function insertion for process_line

You have an opportunity to introduce a new string method while improving the functionality of the code. Just a suggestion, but why not introduce the string replace method, and at the same time reduce number of lines of code as follows:

def process_line(line):
found = True
while found:
for word in keywords:
if word in line:
answer = input('Enter a ' + word + ': ')
line = line.replace(word, answer)
else:
found = False
return(line)

Is there a problem with doing it this way? It also takes care of the VERB!!! problem you talk about.

Steve Lamb  Jan 05, 2019 
Printed Page 411
right margin

The error may show in e-book too.

The error is the author uses two different but same meaning words: VERB_ING and VERB_WITH_ING.
The text should show only one of them, not two.
So, if you want to go with VERB_ING, then don't use VERB_WITH_ING later. It is minor technical error but it confuses the students. Thanks.

Kwan Kim  Nov 04, 2021 
PDF Page 416
page heading

"exploring exception" should probably be plural:
"exploring exceptions"

Jørgen Lang  Apr 03, 2018 
PDF Page 418
page title ("running head")

Original: "how to handle expectations".
Should probably be: "how to handle exceptions"

But then… that's just what I'd expect to see… maybe throw an unexpected exception

Jørgen Lang  Apr 03, 2018 
PDF Page 421
code example below 2nd paragraph

Original: "Let's store the crazy lib filename in a variable to…"

"Crazy Lib" refers to the game and thus should be uppercase:
""Let's store the Crazy Lib filename in a variable to…""

Jørgen Lang  Apr 04, 2018 
PDF Page 425
Bullet Points

function and method names are formatted bold instead of fixed-width (for code).

Jørgen Lang  Apr 17, 2018 
PDF Page 426
bottom left

Crossword 19 across: "Cleans up the ends of strings."
Answer: strip

This implies that strip only works on the end of a string and contradicts what the reader learned in chapter 9. strip removes from the beginning and the end of a string. To remove only from the end, you'd use rstrip.

Jørgen Lang  Apr 04, 2018 
PDF Page 432
1st paragraph, 1st sentence

Text: "…change your directory to the location of your crazy.py file…"

The explanation on how to do this is on the next page. A reference or hint should be added, e.g.

"…change your directory to the location of your crazy.py file (see the following page on how to do this)…"

Jørgen Lang  Apr 04, 2018 
PDF Page 433
heading

Inconsistent headings: Heading on page 426 (Coding Cross) is used throughout the book. On page 433 (solution) the heading "File i/o cross Solution" is used.

Jørgen Lang  Apr 04, 2018 
PDF Page 435
all odd pages in chapter 10

Throughout the book the chapter title is being used as a "running head" for odd pages. In ch10 'web services' is used instead of "using web apis".

This should probably be changed to "using web apis".

Jørgen Lang  Apr 07, 2018 
PDF Page 436
and following pages throughout the chapter

All these refer to the same thing, so I summarized them.
Occurences of "service" should be replaced by "API".

Here we go:

436 "brain power" 3rd sentence:
"How would you write the app without such a service?"
-> change "such a service" to "such an API"

438 left code annotation between last paragraph and url:
"Here’s another URL to a web service for weather data."
-> change "URL to a web service" to "URL to a web API"

442 screenshot annotation:
"Open Notify supplies three different services."
-> change "three different services" to "three different APIs"

446 Q&A, 1st answer, 3rd sentence:
"But with JSON [...] to another program or service."
-> change "program or service" to "program or API"

449 top left annotation:
"Let’s set a variable url to the URL address of the ISS web service."
-> change "ISS web service" to "ISS web API"

449 "Watch it!", 1st sentence:
"At the time of writing, the ISS location service is a working, healthy service. Of course there are no guarantees in the future; so if for some reason the ISS location service is not operating"
-> change "ISS location service" to "ISS location API"

450 "Watch it!", 3rd sentence:
"Paste the URL into your browser to make sure you have connectivity and the service is up and running"
-> "Paste the URL into your browser to make sure you have connectivity and the API is up and running"

450 "Watch it!", last sentence:
"If it appears as if something is wrong with the Open Notify service, then revisit the Watch it! on the previous page."
-> change "Open Notify service" to "Open Notify API"

450 1st paragraph under "How to use JSON in Python", 1st sentence:
"So we’ve got our response from the ISS location service, [...]"
-> change "ISS location service" to "ISS location API"

457 2nd sentence:
"We’ve got everything in place and we’ve got a location back from the Open Notify service, so all we need to do is put it all together."
-> change "Open Notify service" to "Open Notify API"

462 bullet points, 5th bullet
"Web services respond to requests, sending data, often using the JSON notation."
-> change "Web services" to "Web APIs"

463 xword, 1 down:
"He wrote the ISS location service."
-> change "ISS location service" to "ISS location API"

Disclaimer: Please don't shoot the messenger. ;)

Jørgen Lang  Apr 08, 2018 
PDF Page 439
Spotify URL

Trying the URL via a browser gives this answer:

{
"error": {
"status": 401,
"message": "No token provided"
}
}

Trying the same via curl:

<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>

Jørgen Lang  Apr 05, 2018 
PDF Page 440
thought bubble

" I typedthe Spotify URL into my browser and I got a “no token” error."

Maybe include a hint on page 439 that the reader might not get the expected result and things will be explained on the following page.

If this is intentional, please ignore my erratum about p439

Jørgen Lang  Apr 05, 2018 
PDF Page 442
annotation below 1st paragraph

Original: "the terminal app"

"Terminal" should be written with a capital T since it refers to an actual app with that name.

Jørgen Lang  Apr 05, 2018 
PDF Page 442
Q&A section, 2nd answer, 2nd sentence

"Another great way to find Python
packages is to search for them with Google using
search terms like “python3 request module” or […]"

Change “python3 request module” to “python3 requests module” (plural)

Jørgen Lang  Apr 18, 2018 
Printed, PDF Page 443
bottom

Missing page and chapter number on bottom of page

Jørgen Lang  Apr 05, 2018 
PDF Page 447
Heading

"Now let’s look at that request module again"
Change "request" to "requests" (plural)

Jørgen Lang  Apr 18, 2018 
PDF Page 448
top right, 1st caption for Response object

"The text property holds the real data of the response, typically in JSON format."

Change "property" to "attribute" for consistency?

Jørgen Lang  Apr 18, 2018 
PDF Page 457
2nd last code annotation, page mid

Text: "Let's move to the right coordinate."

To avoid confusion I suggest to rephrase this to "Let's move to the right coordinates."

Otherwise "right" could be seen as a direction.

Jørgen Lang  Apr 07, 2018 
PDF Page 462
2nd bullet point

"A Web API typically provides a documented Application Programming Interface (API) that describes the data it can provide and services it has available."

That would mean, that the API provides an API. I guess what is meant is that the API provides (or comes with) some sort of documentation that describes the data and services.

Jørgen Lang  Apr 07, 2018 
Printed, PDF Page 462
5th paragraph from the right column

The book reads
Using the requests library we issued a request using the get method

but shouldn't it be "issue" instead of "issued"? All other sentences are using the present tense except this one.

Kwan Kim  Nov 16, 2021 
PDF Page 463
xword 17 down

"17. Documented functions of a Web API."
Answer: API

Letters "PI" are not visible. Crossword graphic is probably a tiny bit too wide.

This seems odd. Maybe change the question to something like:
"Users should read this before using a Web API."
Answer: Documentation

(almost 11pm, I might be biased)

Jørgen Lang  Apr 07, 2018 
PDF Page 473
Exercise description, link

"It’s time to do some paper protype testing. Photocopy this page, and the next one (or print a copy from [Errata machine does not like links…protocol removed]wickedlysmart.com/hflearntocode), […]"

The URL does not point to a copy of pages 473/474 respectively. There are no links on that page that lead to copies either (not in the code examples).

Jørgen Lang  Apr 23, 2018 
Printed Page 479
right bottom

There is a diagram showing the neighbors of a cell.
I think there are many wrong notations there. For example,
grid_mode[row][column - 1] should have been grid_mode[row -1][column], etc.

Kwan Kim  May 26, 2021 
PDF Page 483
Sharpen, 1st sentence

"We’re not really exercising the next_gen code […]"

"exercising" or "executing"?

Jørgen Lang  Apr 24, 2018 
PDF Page 489
Bottom code block

In the 'grid' layout manager code for the individual widgets, at least as of Python 3.9, the 'sticky' keyword argument requires its argument as a string, so:

"start_button.grid(row=1, column=0, sticky=W, padx=20, pady=20)"

and

"clear_button.grid(row=1, column=2, sticky=E, padx=20, pady=20)"

will not compile.

These need to read
sticky='W'
and
sticky='E'
respectively.

This error is repeated on the subsequent page (490), as well.

Glenn Lacki  May 09, 2021 
PDF Page 504
directly below figure + bottom code annotation

"left button" (i.e. mouse button) is using the same cognitive "namespace" as "start button", "clear button" (i.e. interface buttons).

Suggestion: use "left mouse button" for better comprehension and to avoid confusion.

Jørgen Lang  Apr 26, 2018 
PDF Page 510
1st sentence

"Now we need to write the code to load a pattern into the grid mode."

"grid mode" -> "grid model"

Jørgen Lang  May 02, 2018 
PDF Page 536
bottom left code annotation

"Note that only ServiceDogs will have this attribute because only ServiceDogs will execute this _init__ method."

Missing left underscore for dunder-init.
Should be: __init__

Jørgen Lang  May 04, 2018 
Printed Page 538
First sentence of first paragraph

"arbitary" should, perhaps, be "arbitrary"

Craig Sadler  Jul 29, 2021 
PDF Page 548
1st code annotation

"Create a frisbeeDog and a Frisbee."

should be

"Create a FrisbeeDog and a Frisbee."
(uppercase "F" for "FrisbeeDog")

Jørgen Lang  May 08, 2018 
Printed Page 550
bottom

else: is missing at the bottom of the code

print and return None has indentation errors.

This error is shown on Kindle version too.

Kwan Kim  Apr 26, 2021 
PDF Page 560
Body of def hire_walker(self, walker)

Existing text:

print('Sorry,', walker.name, ' is not a Dog Walker')

Results in an extra space between the evaluated value of walker.name and "is". Say walker.name evaluates to "Bob", the call to print() would return:

Sorry, Bob is not a Dog Walker

The correct syntax is:

print('Sorry,', walker.name, 'is not a Dog Walker')

Which would result in print() returning:

Sorry, Bob is not a Dog Walker

Keith Wine  Aug 07, 2021 
PDF Page 561
3rd paragraph, 1st sentence

"[…] you could improve the implementation with the iterable pattern that we mentioned much earlier in the book."

The pattern is introduced in chapter 9 as "iterator (design) pattern".

Suggested changes:
* use same wording: "iterator pattern"
* explicitely mention chapter 9 for ease of reference

"[…] you could improve the implementation with the 'Iterator' design pattern that we mentioned in chapter 9 of this book."

Jørgen Lang  May 09, 2018 
PDF Page 567
bullet list, second last bullet point in left row

" The class we’re subclassing is often called the superclass or supertype."

First and only mention of "supertype" in the book.

Jørgen Lang  May 10, 2018 
PDF Page 567
bullet list, 2nd col, 4th bullet point

"Override the str method to return the string you’d like displayed when your object is printed by print."

Missing underscores around "str",
should be "__str__".

Jørgen Lang  May 10, 2018 
PDF Page 567
bullet list, 2nd col, 3rd bullet point

"The isinstance method returns True […]"

According to Python documentation, isinstance is a built-in function, not a method.

Jørgen Lang  May 10, 2018 
PDF Page 567
bullet points

Inconsistent formatting of keywords (e.g. OOP, class, etc.) and code/literals (e.g. __init__).

Jørgen Lang  May 10, 2018 
Printed, PDF Page 568
xword clues

Clues 13, 15, and 16 down are missing in action…

13: A function that belongs to an object.
15: Dog that catches things
16: Define a class from another class

Jørgen Lang  May 10, 2018 
PDF Page 572
bottom code annotation

"And here's the str method […]"

Missing underscores. Should be:

"And here's the __str__ method […]"

Jørgen Lang  May 08, 2018 
PDF Page 573
Body of def walk(self)

Existing text:

print(self.name, 'says, "I can\'t walk, I'm playing Frisbee!"')

Gives "SyntaxError: invalid syntax" because the apostrophe in "I'm" is not escaped. The correct syntax is:

print(self.name, 'says, "I can\'t walk, I\'m playing Frisbee!"')

Keith Wine  Aug 07, 2021 
PDF Page 576
Lyrics example

The lyrics list erroneously has the word "saw" and also transposes the order of "you" and "on". The initial letter "s" and the reversed order of "y" and "o" show up in the last two shell output examples. The existing syntax:

lyric = ['I', 'saw', 'heard', 'on', 'you', 'the', 'wireless', 'back', 'in', '52']

Should be:

lyric = ['I', 'heard', 'you', 'on', 'the', 'wireless', 'back', 'in', '52']

The second shell output example is presently:

['I', 's', 'h', 'o', 'y', 't', 'w', 'b', 'i', '5']

But should be:

['I', 'h', 'y', 'o', 't', 'w', 'b', 'i', '5']

The last shell output example is presently:

['s', 'o', 'y', 't', 'w']

But should be:

['y', 'o', 't', 'w']

Keith Wine  Aug 07, 2021 
PDF Page 579
running head (also on following odd pages)

On pages 579, 581, 583, and 585 the wrong running heads are being used. Also the formatting seems to be incorrect. Words are overlapping.

They should all read "leftovers" to follow usual hf conventions.

Jørgen Lang  May 15, 2018 
PDF Page 580
annotation above Python Shell

"Python represents the empty list (having no items) as set()."

Change "list" to "set":

"Python represents the empty set (having no items) as set()."

Jørgen Lang  May 15, 2018 
PDF Page 586
bottom

repeats book recommendations from ch12, p 566
Is this intentional?

Jørgen Lang  May 10, 2018 
PDF Page 587
quotation marks entry in index

Index entry uses typographical double quotes (U+201C and U+201D) instead of U+0022

Jørgen Lang  May 17, 2018 
PDF Page 594
entry for macOS

redundant entries for "macOS" and "MacOS". Official name is "macOS"

Jørgen Lang  May 17, 2018 
PDF Page 594
"module view controller" entry

"module view controller pattern. See MVC (module view controller) pattern"

should be

"model view controller pattern. See MVC (model view controller) pattern"

Jørgen Lang  May 17, 2018 
PDF Page 597
bottom right

Index entries:

requests (Web APIs) about 437
[...]
request module process 447

and

responses (Web APIs) about 437
[…]
request module process 447–448

In both cases, the sub-entry should read "requests module…" (plural)

Jørgen Lang  Apr 18, 2018 
PDF Page 597
index entry for quotation marks

Index entry uses typographical double quotes (U+201C and U+201D) instead of U+0022

Jørgen Lang  May 17, 2018