"check yourself" doesnt work


#1

print 'Welcome to the Pig Latin Translator!'

Start coding here!

original = raw_input("Enter a word:")

if len(original) > 0 :

 print  original

 else: 
     print "ssoo"

#2

your else statement place is not correct , if and elif and else most be in a same colon :

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

if and else start in col 1
print start in col 5


#3

Don't put a space between if len(original)<0:
It'll mess up your code.


#4

Hello - Can you have a look at my codes

print 'Welcome to the Pig Latin Translator!'

Start coding here!

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

When I ran, it kept saying " File "python", line 7
else:
^
SyntaxError: invalid syntax"


#5

That's an indentation problem indent your if block like this,

if len(original) > 0:
    print original
else:
    print "empty"

#6

Ah...ha... now it works...wow, thank you so much, it is very helpful :grinning:


#7

You're super welcome! :grin:

If that was the answer you were looking for feel free to click the solution button below my reply. :smile:


#8

eh..sorry I can not find the "solution button", or did you mean the heart (like) icon??? :sweat:


#9

No there's one that looks like a tick in a box


#11

I just learned from other post that the soultion button should appear at
the left most under your reply, next to the heart icon, which means to
notify that the problem is solved but I still cannot find it. Here is
what my screen looks like:


#12

It's okay :slight_smile: To see the solution button you had to have been the original poster.


#13

yah. that's what I thought too... :relaxed:


#14

I'm having a problem with this string too. I've checked myself against the answers here and it looks the same but it keeps returning "empty" even if i do type letters. Any ideas?


#15

line 5 shouldn't be there. just call original on the same line like this, :slight_smile:

original = raw_input("Enter a word: ")


#16

i'm facing the same problem!can you post the correct code here?