6.4 -- builtin_function_or_method' has no len()


#1

Hi, I'm working on 6.4 - "Check Yours" and the error I'm getting says "'builtin_function_or_method' has no len()".

Do you know how to make this work? The error is in line 6.

1 print 'Welcome to the Pig Latin Translator!'
2 
3 # Start coding here!
4 name = raw_input("What is your dog's name?")
5 original = raw_input
6 if len(original) > 0: 
7    print original
8 else: 
9    print "empty"

Welcome to the Pig Latin Translator!
What is your dog's name? Birmingham
Traceback (most recent call last):
File "python", line 6, in
TypeError: object of type 'builtin_function_or_method' has no len()


#2

this two lines:

name = raw_input("What is your dog's name?")
original = raw_input

should be one line:

original = raw_input("What is your dog's name?")

the error is caused by the fact that you call the raw_input function without ()


#3

That's great. I was looking for the error in line 6 but the error originated in line 4. Thanks for your help.


#4