Cody Bable

Generation

generate functionWed, 19 Apr 2023

remove punctuations from a sentence and split the sentence into a list

def remove_punctuations(s): s = s.replace(',', '') s = s.replace('.', '') ... remove_punctuations('The quick brown fox jumps over the lazy dog.') # ['The', 'quick', 'brown', 'fox', 'jumps', 'over', 'the', 'lazy', 'dog']

Questions about programming?Chat with your personal AI assistant