title: Filter Anagram in Array in Python
body: <p>I'm trying to go through an array and delete the elements that aren't anagrams in python.  Here is the code I wrote.  My logic seems fine but I can't seem to get it.</p>
  
  <pre><code>b = ['cat', 'dog', 'god', 'star', 'lap', 'act']
  array=[]
  t=0
  for i in b:
      while t&lt;len(b):
          if ''.join(sorted(i))==''.join(sorted(b[t])):
             array.append(i)
          t+=1
  print array
  </code></pre>