Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
check if any permutations of a word is a palindrome - python
#python 3.6.9 def palindrome(word): key_value = {} size = len(word) for letter in word: key_value[letter] = key_value.get(letter, 0) + 1 odd = 0 for key in key_value: if key_value[key] % 2: odd = odd +1 if odd > 1 : return False return True inps = ["civic", "ivicc", "civil", "livci", "tmp", "ovo"] for inp in inps: print(inp , palindrome(inp))
run
|
edit
|
history
|
help
0
PySetUnpack
Filter dictionaries with specific keys (using list comprehension)
gameboy
Convert between degrees and radians
Python regex to find repetitive word count
Printing
cat
Supermarket prices and stock
on_off
on_off_3