Need to know why this doesnt work and how to make it work


#1



File "python", line 5
if len(original) > 0
^
SyntaxError: invalid syntax


To ask for a word, if i type anything with at least 1 character it should print that word, if i dont type anything, it should print "error"


print 'Welcome to the Pig Latin Translator!'

# Start coding here!
original = raw_input("Enter a word:")
if len(original) > 0
    print original
else print "error"


#2

if condition: # Don't forget the : at the end of the if statement!

now Indentation

if len(original) > 0:   
    print original   #need 4 sapces
else:      # remember  : after else
    print "error"  #need 4 spaces

you last print statement should be at next line (check Indentation )


#3

god im stupid, thank you so much! greatly appreciated


#4

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