Check Yourself


#1

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

Issue with my code in that the text appears, including the "Enter a word:" but when I press enter I get this message...
Traceback (most recent call last):
File "python", line 6, in
TypeError: object of type 'builtin_function_or_method' has no len()

What am I missing?


print 'Welcome to the Pig Latin Translator!'

# Start coding here!
raw_input ("Enter a word:")
original = raw_input   
if len(original) > 0:
    print original
else:
    print "empty"


#2

Hi

I also did this one today -

print 'Welcome to the Pig Latin Translator!'

Start coding here!

original = raw_input("Enter a word:")
if len(original) > 0:
print original
else:
print "empty"

I firstly used the variable
'original'
and saved the results of the raw input in that variable.
That seems to be the only difference between us.
I hope this helps.


#3

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