Cody Bable

Generation

generate functionWed, 19 Apr 2023

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

# Punctuations punctuations = '''!()-[]{};:'"\,<>./?@#$%^&*_~''' def remove_punctuations(text): no_punct = "" for char in text: if char not in punctuations: no_punct = no_punct + char return no_punct remove_punctuations("Hello!!!, he said ---and went.")

Questions about programming?Chat with your personal AI assistant