Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

remove punctuation python string library

import string 
sentence = "Hey guys !, How are 'you' ?"
no_punc_txt = ""
for char in sentence:
   if char not in string.punctuation:
       no_punc_txt = no_punc_txt + char
print(no_punc_txt);                 # Hey guys  How are you 
# or:
no_punc_txt = sentence.translate(sentence.maketrans('', '', string.punctuation))
print(no_punc_txt);                 # Hey guys  How are you 
Source by www.pythonpool.com #
 
PREVIOUS NEXT
Tagged: #remove #punctuation #python #string #library
ADD COMMENT
Topic
Name
8+2 =