It seems like there should be a simpler way than:

import string
s = "string. With. Punctuation?" # Sample string 
out = s.translate(string.maketrans("",""), string.punctuation)

Is there?

32 s
32

Leave a Reply

Your email address will not be published. Required fields are marked *