4. Check Yourself Error with Else Statement



The Else statement in my code does not print "empty". The if statement works, but the else part doesn't.
I believe that I have everything set up correctly, but I do not know why it doesn't work.

print 'Welcome to the Pig Latin Translator!'

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


here, don't pass original as a string.


And you need to first define it before checking it. I hope you did that in the earlier excercises.


How does one define original? Because I somehow passed the previous exercise...


You are supposed to ask the user to input a word using the raw_input() method. So first create a variable original.

original =

Then Ask user for input.

raw_input("String asking user for input: ")

The line above should be stored in the variable original


This is an example that asks a user for their name.

name = raw_input("What's your name? ")


That's what I did in my original code... It works for the if statement. If I don't use quotes around "original", the if statement doesn't work. (I can technically still pass this assignment, but I feel like fixing the else statement.)


Please post all your code


Without quotes:

With quotes:


Remove the' ' around original.


It is not a string. Just a variable


You've spelt original wrong on line 5