What makes my code wrong?


#1



https://www.codecademy.com/courses/python-beginner-2W5v7/0/4?curriculum_id=4f89dab3d788890003000096#

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'
    else:
        print 'Empty'

#2

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.


#3

remove spaces before if
should look like

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

and dont you want to print the value of original?


#4

also put a colon after the if statement


#5

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