Help with check yourself


Hi. This is my code. I have had trouble for a while:

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

The error comes up as:
Your code looks a bit off. Check the Hint if you need help!

I checked the hint section and it hints to use the ">" symbol. I obviously am using the > symbol in the third line.

Apparently there is something wrong with line 5 as well which would be the "else:" line.... it says it is an invalid syntax. I don't know what is wrong with line 5. It looks correct, unless if I am missing something.
Help please. Thanks in advance.


it looks like your else is indented too much. Put it in line with the if section. Also, make sure to use a : not a ;.


I figured that out. Thanks. Does it really matter about indenting that much that the whole system will go crazy if your else or print isn't indented properly?


Yeah man, else; would be a statment, but what you really want is else (statement);


I am pretty sure indentation does not matter, I am not aware of a compiler that reads most white space. indentation is usually for us hoomans :stuck_out_tongue:


In other languages, indentation just helps make it more readable.

In Python indentation does matter. If you're familiar with javascript, indentation is basically the equivalent of javascript's brackets. Here's a video that explains it better.

Also, from what I've read python isn't necessarily a compiled language. You can compile it to make it more efficient, but generally it's not. I'm a noob though so that's just what i've read :stuck_out_tongue_winking_eye:


oh cool! :stuck_out_tongue: yeah I have no experience with python, I am mainly into C. Learn something new every day


Nice! Where'd you learn C? I need to find place to learn that lol


Lol, I am a uni student :stuck_out_tongue: C is great. once you learn C, you will abandon your love for Java (if you have any lol)