title: Having trouble removing punctuation and upper case letters? (Beginner)
body: <p>Awful programmer here. For a class assignment I have to take words from a text document, count them, and order them. I am having trouble erasing the punctuation and replacing the upper case letters with lower ones. Any guidance would be greatly appreciated.</p>
  
  <pre><code>docwords={}
  doc=raw_input("Please enter the name of a text file: ")
  docread=open(doc, 'r')
  doclist=[]
  
  
  
  def main():
      for x in docread:
          words = x.split()
      for word in words:
          doclist.append(word)
  
  def wordcount():
      main()
      for counter in doclist:
          docwords[counter] = docwords.get(counter,0) + 1
  
  wordcount()
  docread.close()
  for p in sorted(docwords):
      print p, "--&gt;", docwords[p]
  </code></pre>