if sorted(s1) == sorted(s2):
print("The strings are anagrams.")
else:
print("The strings aren't anagrams.")
def anagram_checker(first_value, second_value):
if sorted(first_string) == sorted(second_string):
print("The two strings are anagrams of each other.")
out = True
else:
print("The two strings are not anagrams of each other.")
out = False
return out
first_string = input("Provide the first string: ")
second_string = input("Provide the second string: ")
anagram_checker(first_string, second_string)
Print(anagram_checker("python", "typhon"))
True
// for 2 strings s1 and s2 to be anagrams
// both conditions should be True
// 1 their length is same or
len(s1)==len(s2)
// 2 rearranging chars alphabetically make them equal or
sorted(s1)==sorted(s2)