Best Answer · By JanBask Python Expert
Answered on Feb 22, 2021
You can use the string.translate approach as it is very fast and easy to use.
s.translate(None, string.punctuation)
For higher versions of Python use the following code:
s.translate(str.maketrans('', '', string.punctuation))