 ## Building Python Programs, 1st edition by Stuart Reges, Marty Stepp, and Allison Obourn

Authors' official companion web site

## First Edition Errata

• p83 - The example output shown at the top of the page is incorrect from the lines:
```year = 2021
month = 1
day = 20
print("Today is", year, month, day, sep="/")
```
The output is actually:
`Today is/2021/1/20`
This is actually not the desired output. A better solution would be:
```print("Today is: ", end="")
print(year, month, day, sep="/")
```
(thanks to Jeremy Zhang)
• p211 - Exercise 3.6, quadratic, lists two examples of equations and their roots. Due to a formatting error, the equations listed are incorrect. They should be:
• x2 - 7x + 12: x = 4, x = 3
• x2 + 3x + 2: x = -1, x = -2
(thanks to Jonathan Koppelman)
• p508 - the line of code:
`lis.insert(lis[i])`
should be:
`lis.append(lis[i])`
• p513 - the list shown is missing a closing `]` brace. It should be: `[36, 12, 25, 19, 46, 31, 22]`
• p556 - The first sentence at the top of the page should read, "What keys and values are contained in the following map dictionary after this code executes?"
• p558 - In Self-Check 8.12 part (c), the word "kwyjiby" should be "kwyjibo".
• p559 - In Self-Check 8.19, the problem lists several sets named `people`, `male`, `female`, `young`, `old`, `silly`, and `hungry`. There should also be sets named `rich` and `poor`.
• p629 - In Self-Check 9.14, the code should call `fibonacci` rather than `fib`. The complete code should be:
```def fibonacci(n):
if n <= 2:
return 1
else:
return fibonacci(n - 1) + fibonacci(n - 2)
```
• p704 - In the code listing on line 16, the `if` test is incorrect. Its `<=` operator should be `<` . The line of code should be:
```if self.day < self.days_in_month():
```
• p720 - In the code listing on line 42, the `if` test is incorrect. Its `<=` operator should be `<` . The line of code should be:
```if self.day < self.days_in_month():
```
• p732 - Self-Check 11.8 refers to a `compute_interest` method; the heading shown is incorrect. It should be:
`def compute_interest(self, rate)`
• p733 - Exercise 11.2 refers to the `from_absolute_day` method as an accessor. It should be referred to as a mutator method, since it modifies the `Date` object.
• p783 - Exercise 12.4 lists the wrong formula for the area of a circle. It should be: π r2.

### Reporting Errors:

Have you found an error in our textbook? If so, please email us at:

authors AT buildingpythonprograms DOT com