Check Yourself!


Hi eveyone!
Would you please tell me what is worng with my code?!

Traceback (most recent call last):
File “python”, line 6, in
TypeError: object of type ‘builtin_function_or_method’ has no len()

print 'Welcome to the Pig Latin Translator!'

raw_input("Enter a word:")

original = raw_input

if len(original) > 0:
    print original

    print 'empty'


you prompt the user for input, raw_input("Enter a word:"), but then you don’t store the result of the prompt anywhere?

then on the next line, you store the function itself in original variable, so original is now a function which can prompt the user for input

You need to merge those two lines


Oh thanks!
I only had to add () after raw_input


so now you are prompting the user twice?


Yes. Now I notice that. What is the right way to merge them?

how i supposed to store the result? I guess it already storing by assinging raw_input to orginal var.


yep, so you need one raw_input and assign it to original variable.


I got it.Thank you :hugs: