Page 257
There are two typos in the code example:
Page 360
At the end of the sixth paragraph, the url www.pylogo.org has changed to http://pylogo.sourceforge.net.
Page 95
At the end of the fourth paragraph, add the following:
Note that when you see __init__ in the code, there are two underscores on either side of 'init'. That's two underscores before and two underscores after, not just one on either side.
Page 111
The code for Question 3 of the "Test yOur knowledge" section should read as follows:
for i in range(5):
for j in range(3):
print '*',
print
Page 152
At the end of the first paragraph (right before the Carter Says), add the following:
It's a little hard to see, but there are two underscores on either side of the 'init'. That's a total of 4 underscores, two on either side.
Page 153
At the end of the fifth paragraph (just before the heading 'What's "self"?', add the sentence:
"All the "magic" methods use two underscores before and two underscores after the name of the method.
Page 161 and 162
In the code snippet at the bottom of the page, the line
GameObject.__init__(self)should be
GameObject.__init__(self, "coin")
Page 206
The first annotation in the second code snippet,
Adds the location argumentshould read
Adds the speed argument.
Page 223
The installer does not install the Pygame documentation. Starting at the third paragraph, it should read:
There are quite a lot of them, so I won't list them all here. But they're on the Pygame web site. You can find the list of events in the event section of the Pygame documentation:
http://www.pygame.org/docs/ref/event.html
The list of key names is in the key section:
http://www.pygame.org/docs/ref/key.html
Page 227
In the second paragraph
10 pixels up or downshould read
30 pixels up or down.
Page 257
There are two typos in the code example:
Page 263
In the 5th code snippet, 'Cel' should be 'cel' (lowercase 'c')
Page 339
In listing 24.1, in line 10, there is an 'A' at the end of the line
ship_mass = 5000.0
The 'A' should not be there.
Page 381
The second-last code snippet on the page should read as follows:
class InterestAccount(BankAccount):
def __init__(self, acct_number, acct_name, rate): BankAccount.__init__(self, acct_number, acct_name) self.rate = rate
def addInterest (self): interest = self.balance * self.rate print "adding interest to the account,", self.rate * 100, "percent" self.deposit (interest)
And the first line of the last code snippet should be:
myAccount = InterestAccount(234567, "Warren Sande", 0.11)
Page 385
Answer to Question #5, Chapter 18, should be pygame.USEREVENT instead of pygame.NUMEVENTS
Page 11, Listing 1.2
The second line should read:
secret = random.randint(1, 99)
Page 35
The e-notation graphic
0.00000000000011752 = 1.752e-13should be
0.0000000000001752 = 1.752e-13(an extra '1' was added in typesetting)
Page 48
The sentence:
"Even if the user enters a float, it will get rounded down (chopped off) to an integer."should be deleted.
Page 59, Listing 6.5
The second line should read:
secret = random.randint(1, 99)
Page 74
The second bullet should read,
"those that repeat until a certain thing happens—these are called conditional loops because they keep going as long as some condition is true"
Page 95
At the end of the fourth paragraph, add the following:
Note that when you see __init__ in the code, there are two underscores on either side of 'init'. That's two underscores before and two underscores after, not just one on either side.
Page 111
The code for Question 3 of the "Test yOur knowledge" section should read as follows:
for i in range(5):
for j in range(3):
print '*',
print
Page 119
4th paragraph, the 2nd sentence should read
"A list has square brackets, so for extend(), you could have both round and square brackets."
Page 152
At the end of the first paragraph (right before the Carter Says), add the following:
It's a little hard to see, but there are two underscores on either side of the 'init'. That's a total of 4 underscores, two on either side.
Page 153
At the end of the fifth paragraph (just before the heading 'What's "self"?', add the sentence:
"All the "magic" methods use two underscores before and two underscores after the name of the method.
Page 161
In the code snippet at the bottom of the page, the line
GameObject.__init__(self)should be
GameObject.__init__(self, "coin")
Page 257
There are two typos in the code example:
Page 339
In listing 24.1, in line 10, there is an 'A' at the end of the line
ship_mass = 5000.0
The 'A' should not be there.
Page 385
Answer to Question #5, Chapter 18, should be pygame.USEREVENT instead of pygame.NUMEVENTS