ElementsOfDataScience icon indicating copy to clipboard operation
ElementsOfDataScience copied to clipboard

NameError: name 'string' is not defined in 05_dictionaries.html

Open hexagonrecursion opened this issue 3 years ago • 0 comments

The html version of you book contains an exception where an output is expected:

https://allendowney.github.io/ElementsOfDataScience/05_dictionaries.html#punctuation

After the paragraph "Here’s what happens when we try to remove the punctuation"

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-2-28f1a7003571> in <module>
      1 for word in line.split():
----> 2     word = word.strip(string.punctuation)
      3     print(word)

NameError: name 'string' is not defined

hexagonrecursion avatar Feb 14 '22 12:02 hexagonrecursion