Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

remove punctuation from a list of strings python

import string
words = ["hell'o", "Hi,", "bye bye", "good bye", ""]
words = [''.join(letter for letter in word if letter not in string.punctuation) for word in words if word]
print(words)
Source by www.delftstack.com #
 
PREVIOUS NEXT
Tagged: #remove #punctuation #list #strings #python
ADD COMMENT
Topic
Name
2+4 =