def IsAnagram(string1,string2): lenth = len(string2) total = 0 for char in string1: if char in string2: total += 1 if total == lenth: return True return False print(IsAnagram("amd","madd"))