Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Verify anagrams solution in Clear category for Verify Anagrams by michal_bien
def verify_anagrams(first_word, second_word):
first_word = list(first_word.lower())
second_word = list(second_word.lower())
while ' ' in first_word: first_word.remove(' ')
while ' ' in second_word: second_word.remove(' ')
while len(first_word)>0 and len(second_word)>0:
if len(first_word)!=len(second_word):
return False
if first_word.count(first_word[0])!=second_word.count(first_word[0]):
return False
else:
second_word.remove(first_word[0])
first_word.remove(first_word[0])
return True
Oct. 7, 2016