title: removing punctuation from the word with function. Language: python
body: <p>I am trying to define a function which will take  one parameter, a string which represents a word, and removes characters considered punctuation from everywhere in the word. I am trying to use the .replace() function only.</p>
  <p>For example: if the word is &quot; inc#credi!ble&quot; it will return &quot;incredible&quot;. However, the one I am writing now is replacing only one parameter. Below is the code:</p>
  <pre><code>punctuation_chars = [&quot;'&quot;, '&quot;', &quot;,&quot;, &quot;.&quot;, &quot;!&quot;, &quot;:&quot;, &quot;;&quot;, '#', '@']
  def strip_punctuation(word):
     for char in word:
         if char in punctuation_chars: 
             char_without_punct = word.replace(char,&quot;&quot;,)
     return char_without_punct
  </code></pre>
  <p>y = strip_punctuation(&quot;#incr!edible&quot;)
  print(y)</p>