Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import collections
- def is_anagram (word1, word2):
- return collections.Counter(word1) == collections.Counter(word2)
- print (is_anagramma('сосна', 'насос'))
- >> True
- print (is_anagram('раскраска', 'каркас'))
- >> False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement