Question: Please answer in python. Write an iterative function remove Pun () which removes the following punctuations (,,,,?,,!, ;,,:) from a given string and returns a
Please answer in python.

Write an iterative function remove Pun () which removes the following punctuations (",,",","?,",!", ";,",:") from a given string and returns a string which does not include the given punctuation characters. Use a for loop to traverse through the collection (i.e. the string), if any element of the string is a character in the parenthesis (.,;:? !) then remove it from the list. To do this you will need to create a new string and initialise it to an empty string outside the for loop. During traversal if a punctuation character is in the collection then don't add it to the new string, all other items are included in the new string. Note: To check if a given character is any one of the following (",, ,",", "?,", "!, ,",", ":"), you can use the following statement; ifcin(",",".","?","!",";,":") removePun("COMP1126!! is a, : lot of, fun?") 'COMP1126 is a lot of fun
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
