Mathematics for the Digital Age and Programming in Python 2nd Edition Errata Hardcover edition ================= p. 4, Figure 1-2 One stray square in Range p. 12, Example 2 Let p(n) be the highest power of 2 that divides n. That is, p(n) is the largest k ... try every value of 2^k under n should be: Let p(n) be the largest k ... try every value of 2^k less than or equal to n p. 32, middle return n*(n+1)/2 should be: return n*(n+1)//2 p. 66, Figure 4.2: The numbers and displacements should be 1, 1/2, 1/3, ... where the length of a brick is 2. See http://www.skylit.com/python/Figure4-2Correction.gif. p. 112, #10, last paragraph: raw_input should be: input p. 113, #12 and solution: isMersenne should be: isMersennePrime p. 157, middle: "but tuples have no methods at all" That was true in Python 2. In Python 3 a tuple has methods count and index. p. 163, paragraph before Example 4: use print >>f, s should be: use print(s, file=f) p. 164, Example 5: print >>f, ' {0:4d} {1:5.2f} {2:7.2f}'.format(qty, price, amt) should be: print(' {0:4d} {1:5.2f} {2:7.2f}'.format(qty, price, amt), file=f) p. 253, Question 4: venn diagram should be: Venn diagram Softcover edition ================= p. 4, Figure 1-2 One stray square in Range p. 12, Example 2 Let p(n) be the highest power of 2 that divides n. That is, p(n) is the largest k ... try every value of 2^k under n should be: Let p(n) be the largest k ... try every value of 2^k less than or equal to n p. 32, middle return n*(n+1)/2 should be: return n*(n+1)//2 p. 44 last paragraph: cordinates should be: coordinates p. 46 Example 1: return math.sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) should be: return math.sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)) p. 53 Example 4: >>> msg = 'You can't change me!' >>> msg 'You can't change me!' >>> niceTry(msg) >>> msg 'You can't change me!' should be: >>> msg = "You can't change me!" >>> msg "You can't change me!" >>> niceTry(msg) >>> msg "You can't change me!" p. 66, Figure 4.2: The numbers and displacements should be 1, 1/2, 1/3, ... where the length of a brick is 2. See http://www.skylit.com/python/Figure4-2Correction.gif. p. 157, middle: "but tuples have no methods at all" That was true in Python 2. In Python 3 a tuple has methods count and index. p. 163, paragraph before Example 4: use print >>f, s should be: use print(s, file=f) p. 164, Example 5: print >>f, ' {0:4d} {1:5.2f} {2:7.2f}'.format(qty, price, amt) should be: print(' {0:4d} {1:5.2f} {2:7.2f}'.format(qty, price, amt), file=f) p. 253, Question 4: venn diagram should be: Venn diagram