Remembers previous input, not returning current correct answer


PygLatin 11/11

I am not receiving an error, but when I try to change the word to translate in the code, it will give me the previous word's answer... when I input a blank, it does return the empty... but it seems to be remembering the previous word and translates that instead

pyg = 'ay'
new_word = word + first + pyg

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
    print new_word
    print 'empty'

is there something I can change in my code to return the most current word input?



@scriptsolver00307: That's because you are, by no meaning, altering the value stored in the variable new_word so you're printing the "old" entry (and such doesn't see to get anything since word wasn't declared, lets say it like this, at any part before using your code).

Edit: try placing that segment of code inside your if statement so it will bring back the correct output.


That fixed it, thank you @g4be !!