Errata in Ljubomir Perkovic's Python text, Introduction to Computing Using Python: An Application Development Focus October 2012 p. 21, line 22: replace "an" with "and" p. 47, problem 2.11: "seheading" should be "setheading" p. 48, problem 2.13: part b) is mistakenly the same as part a) p. 48, problem 2.15: in part b) g should be 'g' p. 48, problem 2.15: in part c) g and a should be 'g' and 'a', respectively p. 48, problem 2.15: in part d) x should be 'x' p. 48, problem 2.15: in part e) d should be 'd' p. 48, problem 2.15: in part e) "midle" should be "middle" p. 50, exercise 2.20: formula should be height = length * sin(angle). p. 50, problem 2.22: problem modified so it does not require concepts covered later. New problem is: Write an expression involving strings s and t containing the last name and the first name, respectively, of a person that evaluates to the person's initials. If the two strings contained the first and last name of this book's author, the expression would evaluate to 'LP'. p. 50, problem 2.25: should be "one or more pairs of parentheses" since part c) requires 2 pairs p. 54, 6th line below module hello.py: replace "and the on" with "and then on" p. 60, Figure 3.2: add closing ")" to print('It is hot!' p. 67, practice problem 3.5: remove extraneous ')' p. 81, line 2: in "... a no longer refers to 3 ...", replace "a" with "x" p. 81, Figure 3.17: replace g() with h() p. 82, Figure 3.18: replace g() with h() p. 86, solution 3.9: add blank space between * and math.pi in last line of function perimeter p. 87, problem 3.13: replace "parallel" with "multiple" p. 87, problem 3.15: in 2nd statement of function olympic() replace jump(t, 0, 0) with turtlefunctions.jump(t, 0, 0) p. 88, problem 3.16: (c) should have correct single quote ' after hello. p. 90, problem 3.32: in last example, >> should be >>>; also, the answer should be 475.00 p. 91, problem 3.33: probability should be 2^{-n}. p. 91, problem 3.37: in second line, "is" should be "if" p. 92, problem 3.39: problem modified so it does not require concepts covered later. New problem is: Write function lastF() that takes as input two strings of the form 'FirstName' and 'LastName', respectively, and returns a string of the form 'LastName, F.'. (Only the initial should be output for the first name.) >>> lastF('John', 'Locke') 'Locke, J.' >>> lastF('Albert', 'Camus') 'Camus, A.' p. 92, problem 3.42: problem modified so it does not require concepts covered later. New problem is: Implement function ion() that takes a string as input and returns True if the entered string ends in 'ion' and False otherwise. >>> ion('congratulation') True >>> ion('marathon') False p. 97, line -13: "... example of string..." should be "... example of a string..." p. 97, line -12: replace ", also" with a period. p. 104: line -2: "... the two columns..." should be "... the two colons..." p. 109, function growthrates(): in docstring replace "1, ..,n" with "1, ..., n"; also, change "format_str" to "formatStr" in the 2nd and 4th line of the function and add a blank space before "n+1" in the 3rd line p. 109, line -6: should be "referred to" p. 126, solution 4.4: add blank space before "n+1" in 2nd line of function even() p. 126, solution 4.6: in docstring of function roster() replace "grad" with "grade" p. 127, solution 4.8: the first two lines of the function definition should be replaced with def words(filename): 'returns the list of words in file filename' p. 128, problem 4.13: s should be 'abcdefghijklmnopqrstuvwxyz' p. 128, problem 4.14: (a) "picture" should be "text file". (b) should say "Assign to variable address the substring of log that ends before the first blank space in log, using the string method split() and the indexing operator." (c) should say "Assign to variable date the slice of string log containing the date (12/Feb ... -6000) ...". p. 128, problem 4.17: in part (b), it should say: "Assign to variable length ..." p. 129, problem 4.18: in part (c) "the" and "all" should be switched. p. 130, left margin: second "File: crypto.txt" should be "File: example.txt" p. 131, problem 4.28: <\a> should be . p. 131, problem 4.29: extra space needed after >>>. p. 131, problem 4.31: should say "... that takes as input the name (a string) of a file in ..." p. 144, function nested(): replace "value" with "values" in docstring p. 145, function nested2(): in 3rd line replace end = ' ' with end=' ' p. 148, line above function incr2D(): replace "len(l[0])" with "len(t[0])" p. 148, function incr2D(): in line before last add blank space between # and j p. 150, 6th line above Practice Problem 10.5: "n" should be "73" p. 152, first line below module ch5.py: replace "parallel" with "multiple" p. 156, 4th line in subsection "continue Statement": should be "... the continue statement does not ..." p. 158, solution 5.3: lines -3 to -5 of function arithmetic() should be diff = lst[1] - lst[0] for i in range(1, len(lst)-1): if lst[i+1] - lst[i] != diff: p. 158, solution 5.4: add blank space before n+1 in line -3 of function factorial() p. 160, function bubblesort(): in outer for loop replace "len(lst)-2" with "len(lst)-1" and in second comment replace "i = len(lst)-2, len(lst)-1, ..., 0" with "i = len(lst)-1, len(lst)-2, ..., 1" p. 163, problem 5.23: the second example should return 475.0 and the third 720.0 p. 165, problem 5.34: the output should be [120.29, -70.67] p. 165, problem 5.35: missing >>>. p. 167, problem 5.40: Sample runs should be: >>> approxPi(0.01) 3.1465677471829556 >>> approxPi(0.0000001) 3.1415927035898146 p. 168, line 3: remove extra "the" p. 172: remove extra "the" in the line following the first code example p. 175, line before Practice Problem 6.2: remove max(), min(), and sum() p. 201, function compareHands(): in line 14 replace "players" with "player" p. 204, solution 6.4: add blank space before {} in line "counters ={}" p. 205, solution 6.8: add blank space before "high" in "def char(low,high)" p. 212, problem 6.35: replace "(as well as print it on the screen)" with "(and return the encrypted content as well)" p. 216, function jump(): replace "x,y" with "x, y" in line 2 and line 4 p. 216, function emoticon(): replace "t,x,y" with "t, x, y" in line 1 and 5, "(x,y)" with "(x, y)" in lines 2 and 5, and similarly add spaces before 2nd and third arguments of function calls in lines 7, 9, 11, and 13 p. 231, function readAge(): add blank space before "age" in line 8 p. 245, solution 7.3: remove "opened" from docstring of function safe-open() p. 248, problem 7.19: function should return the sum of the values input. p. 249, problem 7.21: function safe_input() should return nothing, not None. p. 252: p should be point in the bottom 5 shell statements p. 252: line -5: point() should be just point p. 264: fix Deck code example to >>> card = deck.dealCard() >>> (card.getRank(), card.getSuit()) ('9', ...) >>> card = deck.dealCard() >>> (card.getRank(), card.getSuit()) ('J', ...) >>> card = deck.dealCard() >>> (card.getRank(), card.getSuit()) ('10', ...) p. 264: in 4th line above subsection title "Implementing the Deck ..." remove "contain" p. 264: in line above subsection title "Implementing the Deck ...", replace getSuit() with dealCard() p. 271, right margin: replace "Module: cards.py" with "Module: ch8.py" p. 273, line 7: Should be "... consider two points with the same coordinates necessarily equal." p. 273, last line: missing implementation of function __repr__() which is return 'Point({}, {})'.format(self.x, self.y) p. 275, class Queue: replace "def __init__(self, q = None)" with "def __init__(self, q=None)" p. 294, class Rectangle: replace "2*(self.x+self.y)" in perimeter() method with "2 * (self.x + self.y)" and "self.x+self.y" in area() method with "self.x + self.y" p. 294, solution 8.5: in __init__() method replace "cardList = None" with "cardList=None" p. 299, problem 8.23: in second line of sample usage, remove extra ")" p. 304, problem 8.38: Add the sentence: "You should also insure that the stack can be printed as shown." p. 304, problem 8.39: pq.size() should be changed to len(pq). p. 305, problem 8.40: should be: "... each will override method area using a simpler implementation...". p. 305, problem 8.40: triangle area is s^2 * sqrt(3) / 4. p. 305, problem 8.41: remove "as is". p. 313, module smileyPeace.py: add endquote " after period in line 5 p. 322, module day.py: replace "YYY" in line 7 with "YYYY" p. 325, module keyLogger.py: replace "expand = True, fill = BOTH" in line 18 with "expand=True, fill=BOTH" p. 334, module ch9.py: replace "YYY" in docstring of method compute() with "YYYY" p. 337, module calc.py: replace "row = r+1, column = c" in line 17 with "row=r+1, column=c" p. 340, first program listing: replace "figit" in line 38 with "digit" p. 342, first program listing: add blank space in line 5 before "column" p. 342, second program listing: add "the" in line 1 between "for" and "first" p. 346, problem 9.16: missing period. p. 356, line 2: should be "...prints its digits vertically..." p. 356, Practice Problem 10.2: "Hurrah" should be "Hurray!!!" p. 362, second program listing: add blank space in line 1 before "Turtle" p. 368, both program listings: add blank space in line 1 before "n" p. 372, module ch10.py: replace "foor" in line 10 with "for" p. 378, function kthsmallest(): add blank space in line 1 before "k):" and add "list" in line 2 before "lst" p. 379, right margin: replace "Module: ch10.tex" with "Module: ch10.py" p. 383, second program listing: add blank space in line 7 before "visible" p. 384, first program listing: add blank space in line 1 before "list", in line 5 before "n", and in line 8 before "visible" p. 391, problem 10.26: output should be: >>> pairs1([4, 1, 9, 3, 5], 13) True >>> pairs1([4, 1, 9, 3, 5], 11) False Replace second paragraph with "When done, reimplement the function so it sorts the list first and then efficiently searches for the pair. Analyze the run time of both implementations using the timingAnalysis() app. (Function buildInput() should generate a tuple containing the list and the target.) p. 391, problem 10.27: in line 4, remove quotes around file0.txt. p. 406, Figure 11.4: 'head sq should be 'head' p. 414: in 6th findall() example, output should be ['eeee', 'e'], not ['eeee', 'e]' p. 419, first code fragment: replace crawl22 with crawl2 p. 423, function news(): add blank space to last line just before "n))" p. 423, class MyHTMLParser: add "by depth" in line 3 after "indented", replace "and" in lines 11 and 18 with "an", and add blanks space in lines 13 and 20 just before 'p' p. 426, problem 11.20: should use regular expression to find words. p. 442, 2nd shell statement: should be >>> cur.execute("""INSERT INTO Keywords VALUES (?, ?, ?)""", (url, word, freq)) p. 446, 3rd shell statement from the bottom: "line! =" should be "line !=" p. 453, function getWordIndex(): remove parentheses (around keyVal) in line 2 p. 457: replace function isprime() with prime(), in last line of function countPrimes(), in line following program listing of function countPrimes() p. 457, second program listing: add blank space in line 12 before "starts" p. 458, in module ch12.py: replace "numProcs = None" in line 5 with "numProcs=None" p. 459, line 1 of Parallel versus Sequential MapReduce subsection: remove "a" p. 459, right margin: replace "Module: crosscheck.py" with "Module: ch12.py" p. 460, 2nd code listing, last line: replace "second" with "seconds" p. 463, line 3: replace first "links" with "link" p. 463, solution 12.4: extra quote '''' in front of webdb p. 468, problem 12.23: in line 4 remove "and also a set of words" p. 468, problem 12.24: remove "the"