Checking if any permutation of a string can make it palindrome
You may simply use Counter method of collections module to get the frequency of each character in the given word and then simply create a list of the frequency of a given character modulo 2, and then get the sum of the generated list, So the list will have only 2 values, either 0 or 1, So we calculate the sum of the list, and evaluate the condition of &lt;=1 is True

from collections import Counter

s = "summs"

print sum([i%2 for i in Counter(s).values()]) &lt;= 1