fork download
  1. from string import punctuation
  2.  
  3. # testando com uma palavra
  4. words = ['abc;!.,']
  5. n_words =[]
  6. for word in words:
  7. for p in punctuation:
  8. if p in word:
  9. word = word.replace(p,"")
  10. n_words.append(word)
  11.  
  12. print(n_words)
Success #stdin #stdout 0.02s 9596KB
stdin
Standard input is empty
stdout
['abc']