PygLatin storing only one word


Testing Testing is this thing on

My code will show correct if I use the same word every time.

It would output any word that I enter

pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
    word = orignial.lower()
    first = word[0]
    new_word = word+first+pyg
    new_word = new_word[1:len(new_word)]
    print new_word
    print 'empty'


So in a nutshell I'm not sure why it will output the same word no matter what I enter. I started out with the word Taco which will output acotay. But if I enter say Happy it will still output acotay and proceed to say I'm correct for the lesson.


what you can do to debug your code is to insert print statements after each variable to know what they hold after each computation.
For example after you do this

you insert a print statement after to know what you have done is right

print word


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.