4. Check Yourself Error with Else Statement


#1



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

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.
Thanks!

print 'Welcome to the Pig Latin Translator!'

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


#2

here, don't pass original as a string.


#3

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


#4

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


#5

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


#6

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

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


#7

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.)


#8

Please post all your code


#9

Without quotes:

With quotes:


#10

Remove the' ' around original.


#11

It is not a string. Just a variable


#12

You've spelt original wrong on line 5