C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
Python Program to Remove Punctuation from a StringPunctuation: The practice, action, or system of inserting points or other small marks into texts, in order to aid interpretation; division of text into sentences, clauses, etc., is called punctuation. -Wikipedia Punctuation are very powerful. They can change the entire meaning of a sentence. See this example:
This program is written to remove punctuation from a statement. See this example: # define punctuation punctuation = '''!()-[]{};:'"\,<>./?@#$%^&*_~''' # take input from the user my_str = input("Enter a string: ") # remove punctuation from the string no_punct = "" for char in my_str: if char not in punctuation: no_punct = no_punct + char # display the unpunctuated string print(no_punct) Output: |