4.Check Yourself! (syntax error)


#1



https://www.codecademy.com/courses/python-beginner-2W5v7/0/4?curriculum_id=4f89dab3d788890003000096#

Keep's Giving me this Error :

print 'Welcome to the Pig Latin Translator!'

raw_input("Enter a name.")
original = raw_input

if len(original) > 0:
print original
else :
print "empty"

Error :Traceback (most recent call last):
File "python", line 7, in
TypeError: object of type 'builtin_function_or_method' has no len()

What have i done wrong?



#2

raw_input() prompts the user for input, which you need to store in original variable. This means you only need 1 raw_input, why do you have two?


#3

The assignment is asking for this, we litteraly typed it over, and I don't see two.

Which one is the second one? I'm strugglin' with this one for 2 days now.
And I have the same problem in line 7.


#4

# first raw_input
raw_input("Enter a name.")
# second raw_input
original = raw_input

the second is particular problematic, given you call the function without parentheses, so you store the function object in variable, the function object has no len attribute


#5

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