Created
March 19, 2024 16:18
-
-
Save MahraibFatima/237b23f35aa508790b3d693207ef6fc4 to your computer and use it in GitHub Desktop.
Determine whether the entered strings are anagrams or not.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_anagram(s1, s2): | |
return sorted(s1) == sorted(s2) | |
string1 = input("Enter the first string: ") | |
string2 = input("Enter the second string: ") | |
if is_anagram(string1, string2): | |
print("Anagrams") | |
else: | |
print("Not anagrams") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment