Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python find if strings are 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
 
PREVIOUS NEXT
Tagged: #python #find #strings #anagrams
ADD COMMENT
Topic
Name
7+7 =