Errata
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
| Version |
Location |
Description |
Submitted By |
| Printed |
Page 22
Chapter 5, second code block |
The variables stats.team1.school and stats.team2.school return ParseResults object and not a string. This causes an TypeError exception to be thrown with this message:
TypeError: cannot concatenate 'str' and 'ParseResults' objects
The remedy is to change the effected lines like this:
if stats.team1.score > stats.team2.score:
result = "won by " + str(stats.team1.school)
else:
result = "won by " + str(stats.team2.school)
adding the str() method to pull out the school's name in a string.
It is not clear to me why the '+' concatenation operator needs this help while further down in the code the 'print' format operation does not.
|
Anonymous |
| PDF |
Page 22
second code block |
The variables stats.team1.school and stats.team2.school return ParseResults object and not a string. This causes an TypeError exception to be thrown with this message:
TypeError: cannot concatenate 'str' and 'ParseResults' objects
The remedy is to change the effected lines like this:
if stats.team1.score > stats.team2.score:
result = "won by " + str(stats.team1.school)
else:
result = "won by " + str(stats.team2.school)
adding the str() method to pull out the school's name in a string.
It is not clear to me why the '+' concatenation operator needs this help while further down in the code the 'print' format operation does not.
|
Anonymous |