It seems like there should be a simpler way than:
import string s = \"string. With. Punctuation?\" # Sample string out = s.translate(string.maketrans(\"\",\
I usually use something like this:
>>> s = "string. With. Punctuation?" # Sample string >>> import string >>> for c in string.punctuation: ... s= s.replace(c,"") ... >>> s 'string With Punctuation'