4/11 not working . Please Help


#1

my code is
print 'Welcome to the Pig Latin Translator!'

raw_input = ('Enter a Word')
original = raw_input
if len(original) > 0:
print "5"
else:
print "empty"

It isn't working.


#2

raw_input is a function. Your code tries to overwrite it in this line:

raw_input = ('Enter a Word')

What you want to do is to set value of original to result of raw_input function call:

original = raw_input('Enter a Word')

The second problem is in your if statement. Please read this part of instructions:

If the string actually has some characters in it, print the user's word.

So in your if block you should print original, not"5".


#3

Still not working. I did what you said and I is still not working. I am really getting frustrated
It shoes error:
File "python", line 7
else:
^
SyntaxError: invalid syntax


#4

You posted code without proper formatting and that is why I am unable to check if indentations in your script are correct.

This is correct version:

print 'Welcome to the Pig Latin Translator!'
original = raw_input('Enter a Word')
if len(original) > 0:
    print original
else:
    print "empty"

Please note that if and else blocks have exactly the same indentation level.