×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Python
Posted by: Matthew J_
Added: Jun 22, 2022 1:04 PM
Modified: Jun 22, 2022 1:28 PM
Views: 0
Tags: no tags
  1. import string
  2. string.punctuation
  3.  
  4. #!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
  5.  
  6. my_text = "The well-known story I told at the conferences [about hypocondria] in Boston, New York, Philadelphia,...and Richmond went as follows"
  7. no_punc = my_text.translate(str.maketrans('', '', string.punctuation))
  8. print(no_punc)
  9.  
  10. #The wellknown story I told at the conferences about hypocondria in Boston New York Philadelphiaand Richmond went as follows