What makes my code wrong?



Stuck on the 'Check yourself' PygLatin excercice, can someone help?
Here's my code, when I run it it says :
File "python", line 5
if len(original) > 0
IndentationError: unexpected indent

print 'Welcome to the Pig Latin Translator!'

# Start coding here!
original = raw_input('Enter a word')
    if len(original) > 0 
        print 'Achieve'
        print 'Empty'


Error says it all. Unindent your if and else statements so that it lines up with your original. Also your print statements, move it back one tab space.


remove spaces before if
should look like

original= raw_input("Enter a word:")
    print something
    print something else

and dont you want to print the value of original?


also put a colon after the if statement


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