title: Python error : 'tuple' object has no attribute 'upper'
body: <p>I wanna make word count and list how many times word counted. But </p>
  
  <hr>
  
  <pre><code> f = open("Les.Miserable.txt", 'r')
  
   words = f.read().split()
   words.sort()
   wordCount = ()
  
   for i in range(len(words)):
       words[i] = words[i].replace(".", ""), (",", ""), ("/", ""), ("?", ""), ("!", "")
       words[i] = words[i].upper()
       if words[i] not in wordCount:
           wordCount[words[i]] = 1 
       else:
           wordCount[words[i]] += 1
  </code></pre>
  
  <p>i can see error message 'tuple' object has no attribute 'upper' in</p>
  
  <pre><code>words[i] = words[i].upper()
  </code></pre>
  
  <p>here</p>
  
  <p>and also error message 'tuple' object does not support item assignment in</p>
  
  <p>wordCountint[words[i]] = 1 </p>
  
  <p>Please let me know know what is the problem</p>