Friday, April 21, 2017

Anagram Python

Tags

Code::

def isanagram(s1,s2):
    s1="".join(sorted(s1))
    s2="".join(sorted(s2))
    if s1==s2:
        print("Anagram")
    else:
        print("Not Anagram")
     
     
w1=input("Enter First Word: ")
w2=input("Enter Second Word: ")
isanagram(w1.lower(),w2.lower())


Output: