Se7enSquared
10/13/2019 - 11:13 PM

Strip punctuation from list items

For each item in a list of words, if it contains punctuation, strip it off

import string
listOfWords = [''.join(c for c in s if c not in string.punctuation) 
               for s in listOfWords]