My code is not working


#1

this is my code for Check Yourself (4)

print 'Welcome to the Pig Latin Translator!'

Start coding here!

original = raw_input("Enter a word:")
if len(original) > 0:
print original
else len(orgininal) == 0:
print "Empty"

and the error:

File "python", line 5
if len(original) > 0:
^
IndentationError: unexpected indent


#2

If it's an indentation error, we need you to format your code to see it.

The easiest way is to surround your code in backticks:

```
Code goes in here.
```

#3

Below is your code, which I have formatted for you, the way it's supposed to look:

original = raw_input("Enter a word:")
if len(original) > 0:
    print original
else:
    print "Empty"

Remember that indentation is extremely important in Python, so you need to include those spaces!

I also changed else len(orgininal) == 0: to else: - this is because you don't need conditions for else, Code in the else part of if/elif/else statements will be run if the conditions in none of the other parts are true, like a last resort, so it does not need the condition you gave it.

If you don't understand, just ask and I'd be happy to help.