Why does it work? ;D


#1


The code works


I expected it not to work because len(new_world) cannot be calculated


pyg = 'ay'

original = raw_input('Enter a word:')

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


#2

It doesn't work, you can't calculate the length of something before you defined it.

I get a NameError in my output window:

You might want to rethink this, need help with it?