csev/py4e

Line 13 in py4e/code3/count2.py

sixsixseven opened this issue · 1 comments

Doing Exercise 3 in chapter 10 (Tuples) for the Coursera py4e program and got stuck for nearly two hours because of an incredibly subtle difference in punctuation on Line 13 in py4e/code3/count2.py:

line = line.translate(line.maketrans('', '', string.punctuation))

Suggest line 13 to have a note to indicate there are three arguments in str.maketrans; two blank strings and "string.punctuation" in the third. On first glance (and in my case two hours) it looks like the first argument is a ", " [comma-space] and the second argument is "string.punctuation". One of the drawbacks of using single quotes when one is used to using double quotes!