Python Anagrams/dictionary toy problem