Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Verify Anagrams by Albert.Nowak
def verify_anagrams(first_word, second_word):
first_word=first_word.lower()
second_word=second_word.lower()
list1=[]
list2=[]
for i in range(0,len(first_word)):
if first_word[i]!=" ":
list1.append(first_word[i])
for j in range(0,len(second_word)):
if second_word[j]!=" ":
list2.append(second_word[j])
list1.sort()
list2.sort()
tmp=0
if len(list1)!=len(list2):
return False
else:
for k in range(len(list1)):
if list1[k]==list2[k]:
tmp+=1
if tmp == len(list1):
return True
return False
Dec. 14, 2015