Aashina Arora
Remove the unwanted characters from the given string.

String is : 9,12;32:456
Output : 9 12 32 456

Solution:-

remove_chars = [‘;’, ‘:’, ‘!’, “*”, “ “, ‘,’]
str1 = “9,12;32:456”

for i in remove_chars:
str1 = str1.replace(i, ‘ ‘)
print( str(str1))

By Aashina Arora in Python on Feb 24 2023


Most Popular Job Functions


MOST LIKED QUESTIONS