title: Python for loop not iterating
body: <p>I'm trying to loop through a list of strings and add them to a dictionary if their length equals a length input by the user. When the last loop runs, it only runs one time. I know this because the first word in the dictionary is 8 characters long, and when the user input is 8, it prints just that word, and not the other 8 character words. If the input is 3, an empty dictionary is printed. Why is my loop not iterating through all of the words in the list linelist?</p>
  
  <pre><code>wordLength = raw_input("Enter a word length ")
  word_dict = {}
  infile = open("dictionary.txt")
  
  for line in infile:
      line = line.strip()
      linelist = line.split(" ")
  
  
  for word in linelist:
      if len(word) == int(wordLength):
          if len(word) in word_dict:
              word_dict[len(word)] = word_dict[len(word)].append(word)
          else:
              word_dict[len(word)] = word
  
  print word_dict
  </code></pre>