title: How to write a function that judges if two strings are anagrams in Python?
body: <p>The input of this function is two strings, and the aim is to judge whether these two strings are anagrams. For example, "qwerty" and "qetyrw" are anagrams, which means rearrange the characters in first string can get the second string, case-insensitively. "qwerty" and "QWerTY" are also anagrams. I'm just confused with my function, which returns nothing.</p>
  
  <p>My function is as follows:</p>
  
  <pre><code>def is_anagram(string_a,string_b):
      """returns True if the strings are anagrams of each other
  
      str, list -&gt; boolean"""
      new_a=string_a.lower()
      new_b=string_b.lower()
      i=0
      if len(string_a)!=len(string_b):
          return False
      else:
          while i&lt;=len(new_a)-1:
              if new_a[i] in new_b:
                  list(new_b).remove(new_a[i])
              i=i+1
              break
          if len(list(new_b))==0:
              return True
          else:
              return False
  </code></pre>