Check Yourself!


#1

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

Error:
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

else:
    print 'empty'

#2

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


#3

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


#4

so now you are prompting the user twice?


#5

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.


#6

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


#7

I got it.Thank you :hugs:


#8