Help!


#1




I get this error message after entering a word in the console.

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


I was expecting the console to print what I had entered.


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

this two lines:

raw_input("Enter a word:")

original = raw_input

should be one one line, you can store the result of raw_input directly in original


#3

like this?

original = raw_input("Enter a word:")

#4

yes, like that.


#5

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