Write a program from given string replace each punctuation with


Topic: Write a program from given string replace each punctuation with

Solution

from string import punctuation
str1 = '/*Jon is @developer & musician!!'
print(f"The original string is :{str1}")
replace_char = '#'
for char in punctuation:
    str1 = str1.replace(char, replace_char)
print(f"The strings after replacement : {str1}")



List all Python Programs