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!'")