To start, define a function called strip_punctuation which takes one parameter, a string which represents a word, and removes characters considered punctuation from everywhere in the word. (Hint: remember the .replace() method for strings.)

Respuesta :

Answer:

The code is given below. The punctuation_chars variable contains a list of punctuation to be replaced by the program

Explanation:

def strip_punctuation(word):

   punctuation_chars = ["'", '"', ",", ".", "!", ":", ";", '#', '@']

   for ch in punctuation_chars:

       word = word.replace(ch, '')

   return word

# Testing the function here. ignore/remove the code below if not required

print(strip_punctuation("Hello, how are you. I am good! ,.!#@"))

OUTPUT

Hello how are you I am good

In this exercise, using the knowledge of computational language in python, we have that this code will be written as:

The code is in the attached image.

We can write the python as:

def strip_punctuation(word):

  punctuation_chars = []

  for ch in punctuation_chars:

      word = word.replace(ch, '')

  return word

See more about python at brainly.com/question/13437928

Ver imagen lhmarianateixeira
ACCESS MORE