from collections import Counter def myfun(): a = 'sateesh' b = 'hseetas' if(Counter(a)==Counter(b)): print("Both strings are Anagram") else: print("Both strings are not Anagram") if __name__=="__main__": myfun()
Both strings are Anagram
def myfun(): a = 'sateesh' b = 'hseetas' if sorted(a)== sorted(b): print('Anagrams') else: print("Not anagrams") if __name__=="__main__": myfun()
Anagrams