Word and letter related python code (anagrams, shifts, etc)