Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

check it two words are anagram pyhton

# function to check if two strings are
# anagram or not
def check(s1, s2):
     
    # the sorted strings are checked
    if(sorted(s1)== sorted(s2)):
        print("The strings are anagrams.")
    else:
        print("The strings aren't anagrams.")        
         
# driver code 
s1 ="listen"
s2 ="silent"
check(s1, s2)
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #check #words #anagram #pyhton
ADD COMMENT
Topic
Name
4+1 =