title: Find anagrams of a given word in a file
body: <p>Alright so for class we have this problem where we need to be able to input a word and from a given text file (wordlist.txt) a list will be made using any anagrams of that word found in the file.</p>
  
  <p>My code so far looks like this:</p>
  
  <pre><code>def find_anagrams1(string):
  """Takes a string and returns a list of anagrams for that string from the wordlist.txt file.
  
  string -&gt; list"""
  anagrams = []
  
  file = open("wordlist.txt")
  next = file.readline()
  while next != "":
      isit = is_anagram(string, next)
      if isit is True:
          anagrams.append(next)
      next = file.readline()
  file.close()
  
  return anagrams
  </code></pre>
  
  <p>Every time I try to run the program it just returns an empty list, despite the fact that I know there are anagrams present. Any ideas on what's wrong?</p>
  
  <p>P.S. The is_anagram function looks like this:</p>
  
  <pre><code>def is_anagram(string1, string2):
  """Takes two strings and returns True if the strings are anagrams of each other.
  
  list,list -&gt; string"""
  a = sorted(string1)
  b = sorted(string2)
  if a == b:
      return True
  else:
      return False
  </code></pre>
  
  <p>I am using Python 3.4</p>