title: removing punctuation then counting the no of every word occurance using python
body: <p>Hello everybody I am new to python and need to write a program to eliminate punctuation then count the number of words in a string. So I have this:</p>
  
  <pre><code>import sys
  import string
  def removepun(txt):
      for punct in string.punctuation:
          txt = txt.replace(punct,"")
          print txt
          mywords = {}
          for i in range(len(txt)):
              item = txt[i]
              count = txt.count(item)
              mywords[item] = count
      return sorted(mywords.items(), key = lambda item: item[1], reverse=True)
  </code></pre>
  
  <p>The problem is it returns back letters and counts them and not words as I hoped. Can you help me in this matter?</p>