Errata in Fundamentals of Python: First Programs,

Second Edition

(ISBN-13: 978-1-337-56009-2)

           

Below are the errors that have been discovered in the first printing.  Please report any new errors to mailto:lambertk@wlu.edu.

 

 

Page 3

Line 3 of first full paragraph, “$0.61 = 3 dimes, 1 nickel, and 4 pennies” should be “$0.61 = 2 quarters, 1 dime, and 1 penny”

Page 43

Last line of code at bottom of page, “.” Should be “,”.

Page 78

Fourth line of code at bottom of the page, “math's” should be “math.sqrt

Page 83

Last line of code at bottom, “False”should be “True

Page 108

Third line of output near bottom of page, “Lqydghuv” should be “lqydghuv”.

Page 122

Table 4-3, row 1, column 2, “rw” should be “r+” (two instances).

Page 124

Line 4 of code segment in middle of page, “listofFileNames” should be “listOfFileNames

Page 149

Next to last line of code at top of the page, “__main:"__” should be “__main__":

Page 155

Second line of code at top of the page, info.["job"]” should be  info["job"]

Page 157

Sixth line of second code segment, “table[digit] + binary” should be “binary + table[digit]

Page 187

In function findFiles, the code beginning with "else" in the loop should be dedented 4 spaces, changing

 

for element in lyst:

    if os.path.isfile(element):

        if target in element:

            files.append(path + os.sep + element)

        else:

            os.chdir(element)

            files.extend(findFiles(target, os.getcwd()))

            os.chdir("..")

 

to

 

for element in lyst:

    if os.path.isfile(element):

        if target in element:

            files.append(path + os.sep + element)

    else:

        os.chdir(element)

        files.extend(findFiles(target, os.getcwd()))

        os.chdir("..")

Page 190

Same error in function findFiles as on page 187.

Page 213

First line of third code segment, “def radialpattern” should be “def radialPattern

Page 392

In the program code for the timing1.py file,

 

print("%12s16s" % ("Problem Size", "Seconds"))

 

should be

 

print("%12s%16s" % ("Problem Size", "Seconds"))