Pyglatin code not working


#1

the code doesn't seem to be working even though I have tried different things
this is my code but it isn't working can you guys please help me


print 'Welcome to the Pig Latin Translator!'

original= raw_input ("please type word")
if len(original) > 0:
    else:
    print original 
and the error message that it is coming up with is
File "python", line 5
    else:
       ^
SyntaxError: invalid syntax
and it is also saying "did I accidently delete the variable called original


#2

Hi your if and else statement should have that structure

if (condition) : 
    #do something 
else:
    #do somthing

#3

this is what I have changed my code too
print 'Welcome to the Pig Latin Translator!'

original= raw_input ("please type word")
if len(original):
return > 0
else:
return <0
print original
this is the error code it is coming up with
File "python", line 5
return > 0
^
SyntaxError: invalid syntax
and Oops! Did you accidentally delete the variable called original?


#4

Here

print 'Welcome to the Pig Latin Translator!'

original= raw_input ("please type word")
if len(original) > 0:
    else:
    print original

You should put it like that

print 'Welcome to the Pig Latin Translator!'

original= raw_input ("please type word")
if len(original) > 0:
    #do something if original  length is greater than 0
else:
    print original

Where I put the coment you should put what they aske you to do if the length of original is greater than 0.


#5

Hey, ive been having issues with this.. it keeps giving me this error "Oops, try again. The value for the original variable looks off, make sure that you entered a word containing only letters."

pyg = 'ay'
W = 'wendy'
new_word = W[1:len(W)] +pyg
print new_word

it goes through.. i can not for the love of god find the not letters in my value


#6

I think you're missing the 'original' variable that was input by the user: original = raw_input("Enter a word:")