Write a program to remove punctuation from a string


Topic: Write a program to remove punctuation from a string

Solution

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



List all Python Programs