Code:
# 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:
Execute and get the output.
More Python Programs:
Python Program to check if a Number is Positive, Negative or Zero
Python Program to Check if a Number is Odd or Even
Python Program to Check Leap Year
Python Program to Check Prime Number
Python Program to Print all Prime Numbers between an Interval
Python Program to Find the Factorial of a Number
Python Program to Display the multiplication Table
Python Program to Print the Fibonacci sequence
Python Program to Check Armstrong Number
Python Program to Find Armstrong Number between an Interval
Python Program to Find the Sum of Natural Numbers