Answers for "check if two strings are anagrams python"

3

python anagrams

# 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)
Posted by: Guest on May-13-2020
1

check if two strings are anagrams python

if sorted(s1) == sorted(s2): 
	print("The strings are anagrams.") 
else: 
	print("The strings aren't anagrams.")
Posted by: Guest on April-07-2020

Code answers related to "check if two strings are anagrams python"

Python Answers by Framework

Browse Popular Code Answers by Language