0 votes
in Python by
Checking whether the two words are anagrams or not

1 Answer

0 votes
by
from collections import Counter

def is_anagram(str1, str2):

return Counter(str1) == Counter(str2)

print(is_anagram('majix', 'magic'))  

print(is_anagram('majix', 'xijam'))

Output:

False

True

Related questions

0 votes
asked Jun 13, 2019 in Python by Derya
0 votes
asked Jun 24, 2020 in Python by Robindeniel
...