Program : Python program that checks if two given strings are Anagrams of each oth er
def are_anagrams(str1, str2):
return sorted(str1) == sorted(str2)
if __name__ == "__main__":
string1 = input("Enter the first string: ").lower()
string2 = input("Enter the second string: ").lower()
if are_anagrams(string1, string2):
print("The two strings are anagrams.")
else:
print("The two strings are not anagrams.")
OUTPUT :
Enter the first string: I Love You
Enter the second string: I Love You
The two strings are anagrams.
Enter the first string: hellopython
Enter the second string: HelloPython
The two strings are anagrams.
Python program that checks if two given strings are Anagrams of each other .
Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated