When re-running my code if I change the word then it gives me the translation for the previous word. If I then run it again with the same word it will come out correctly translated. So basically I have to run the same word twice to get the correct translation. Or, put another way. it is translating the last word instead of the current one.
Any ideas what I did wrong?
pyg = 'ay' new_word = word + first + pyg new_word = new_word[1:] original = raw_input('Enter a word:') if len(original) > 0 and original.isalpha(): print original word = original.lower() first = word print new_word else: print 'empty'