Python , 8 Word Up PygLatin-Code help


#1

The code below (all the way down) to do with PygLatin wordUp -8 seems to work fine by and large. if the word is NOT alphanumeric I want it to print the word entered in lowercase AND print the first letter of that word. if the word is alphanumeric or if I just hit the enter key I want it to go the else statement and say empty. It does this and executes the code but gives the following message when I dont give a word and just hit ENTER or give an alphanumeric word

Oops, try again. It looks like word is set to "roach" instead of "".
BTW roach is the previous nonalphanumeric word that I tried

pyg = 'ay'

original = raw_input('Enter a word:')

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

WHY IS THIS SO AND HOW CAN I CORRECT IT SO THAT IT DOES NOT GIVE THAT MESSAGE

THANKS


#2

I am having a problem with the same problem, but for me it says "Did you create a variable called word?" When I obviously did.


#3

I have the same problem with all my subsequent codes as well in the PygLatin exercise. Anytime I just hit enter (without giving a word) or give an alphanumberic word it gives a message:

Oops, try again. The value for the original variable looks off, make sure that you entered a word containing only letters.

It works fine when I put in word

pyg = 'ay'

original = raw_input('Enter a word:')

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


#4

pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
word = original.lower()
first = word[0]
print original

else:
print 'empty'

I do it. I come from china. my english is poor. but i nenver give up.


#5

pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
word = original.lower()
first = word[0]
print original

else:
print 'empty'

I have already done this course and passed it, but now i am stuck on it again...


#6

It says line ten INVALID SYNTAX


#7

I just need the code again. since i am just reviewing


#8

nevermind i figured it out


#12