Cody Bable

Generation

generate functionWed, 19 Apr 2023

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

def remove_punctuation(input_string): """ See assignment description """ sentence=input_string.replace(".","") sentence=sentence.replace(",","") sentence=sentence.replace("'","") sentence=sentence.replace("’","") sentence=sentence.replace("?","") sentence=sentence.replace("!","") sentence=sentence.replace(";","") sentence=sentence.replace(":","") sentence=sentence.replace("-","") sentence=sentence.split(" ") return sentence

Questions about programming?Chat with your personal AI assistant