title: How to make a dictionary that counts repeated amount of length of any words from a file?
body: <p>How do I correct this so my dictionary reads length of a word = how many times the length of the word is repeated? Parameters is a file.</p>
  
  <pre><code>def wordLengths(fileName):
      d = {}
      f = open(fileName)
      filename.close()
      for line in f:
              for word in line:
                  if len(word) not in d:
                      d[len(word)] = count.len(word)
      return(d)
  </code></pre>