Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Granams solution in Clear category for Verify Anagrams by Seaclaid
def verify_anagrams(word1, word2):
odp=False
word1=word1.lower()
word2=word2.lower()
word1=word1.replace(' ','')
word2=word2.replace(' ','')
temp1=[]
temp2=[]
print(word1,word2)
if len(word1)!=len(word2):
odp=False
return odp
for i in range(len(word1)):
t1=[word1[i]]
t2=[word2[i]]
temp1=temp1+t1
temp2=temp2+t2
temp1.sort()
temp2.sort()
for i in range(len(word1)):
a=temp1.count(temp1[i])
b=temp2.count(temp1[i])
if a==b:
odp=True
else:
odp=False
return odp
return odp
if __name__ == '__main__':
#These "asserts" using only for self-checking and not necessary for auto-testing
assert isinstance(verify_anagrams("a", 'z'), bool), "Boolean!"
assert verify_anagrams("Programming", "Gram Ring Mop") == True, "Gram of code"
assert verify_anagrams("Hello", "Ole Oh") == False, "Hello! Ole Oh!"
assert verify_anagrams("Kyoto", "Tokyo") == True, "The global warming crisis of 3002"
Jan. 8, 2017