Checking if two strings are permutations (anagrams) in Python
From Sumit Raj's 2015 article 10 Neat Python Tricks Beginners Should Know, which I would classify as "more pythonic":

from collections import Counter
def is_anagram(str1, str2):
    return Counter(str1) == Counter(str2)
&gt;&gt;&gt; is_anagram('abcd','dbca')
True
&gt;&gt;&gt; is_anagram('abcd','dbaa')
False