I have looked at several answers on Best way to strip punctuation from a string in Python but none of these seem to address my problem. I am trying to strip punctuation from a string using string.translate().
When I run the code:
import string
s = "This. has? punctuation,"
noPunct = s.translate(s.maketrans("",""), string.punctuation)
I get:
TypeError: translate() takes exactly one argument (2 given)
Is this perhaps an issue with the python version I am using? I am using python 3.5.4 for compatibility with nltk. Otherwise I am stumped. Any help would be appreciated.