Help me please


#1

help me please

print 'Welcome to the Pig Latin Translator!'

Start coding here!
raw_input("Enter a word:")
original = raw_input()
if len(original)> print original:

else > print "empty"

File "python", line 6
if len(original)> print original:
^
SyntaxError: invalid syntax


#2

Let's look at your code:

original = raw_input()

Here you attempt to assign raw_input() to the variable original. raw_input is a function which is correctly called above this piece of code. You could simply use the first line and assign to assign original.

if len(original)> print original:

The correct syntax for an if/elif/else statements is:

if this:
  do this

elif this:
  do this:

else:
  do this

So your code should say:

if len(original) > ??:
  print original

else:
  print "empty"

#3

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