Need help on check your self


#1



check yourself 4 piglatin

its states that SyntaxError: 'return' outside function

the code only show an error and asks if i deleted the variable original which i did not


Replace this line with your code. 
print 'Welcome to the Pig Latin Translator!'

# Start coding here!

raw_input("enter a word")
original=raw_input()
len.original
if len(original) > 0:
   return True
   print original
else: 
   return True
   print ""


#2

return can only be used inside a function, you don't have a function?


#3

ok this is what i have now

`print 'Welcome to the Pig Latin Translator!'

# Start coding here!

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

now i am gettin this error
Traceback (most recent call last):
File "python", line 7, in
AttributeError: 'builtin_function_or_method' object has no attribute 'original'

the code runs but it wont end properly


#4

you can store the result of raw_input directly into original, so this:

raw_input("enter a word")
original=raw_input()

should be one line

this line:

len.original()

what is it suppose to do? remove it, len has no original method


#5

thank you forgot that i did not have to state len.original


#6

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