Cody Bable

Generation

generate functionWed, 19 Apr 2023

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

def punctuation_removal(sentence): punctuations = '''!()-[]{};:'"\,<>./?@#$%^&*_~''' no_punct = "" for char in sentence: if char not in punctuations: no_punct = no_punct + char return no_punct.split() punctuation_removal("'I am learning python!'")

Questions about programming?Chat with your personal AI assistant