I have the following exercise: Two words are anagrams if you can rearrange the letters from one to spell the other. Write a function called is_anagram that takes two strings and returns True if they are anagrams.
I have developed a function, but it is not working properly and I cannot find out why. Could anybody tell me what I am doing wrong? Thank you very much.
def isa(s,t):
if len(s)!=len(t):
print "impossible"
if len(s)==len(t):
i=0
while i<len(s)-1:
for i in s:
if i in t:
print "yay"
print "NO"