4. Check yourself! Pyg Latin


my code doesnt work:

print 'Welcome to the Pig Latin Translator!'

# Start coding here!

original=raw_input("Enter a word: ")


if size>0:
  print original

  else: print "empty"

the error says:

File “python”, line 14
else: print “empty”
SyntaxError: invalid syntax


You nested else inside the if clause, why?

the else should be after if clause, given you want to run it when if condition evaluates to false


oh…thank you alot man…can i give u points or something for helping?


you can check here:


which has a topic:

Quick Tips for Using Forums

which can be useful as you are new to forum, as well as the guidelines

as for the points, no you can’t. You can give likes, to show you liked an answer and found it helpful


And giving your first like also gives you a badge :slight_smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.