Computer Science, asked by malviyavrishank, 11 months ago

Write a Python program to remove punctuation from string. ​

Answers

Answered by krishnaverma05
1

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)

-----------------------------------------------------------------------------------------------------------------

Output :

Hello he said and went

Similar questions
Math, 11 months ago