Check Yourself; Traceback & Type errors


#1



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


I have been stuck with the following issues for the last week now and after several tweaks and adjustments, I am still getting the same errors. These errors have something to do with Traceback and TypeError?!


Here is my code:
raw_input("Enter a word:")
original= raw_input

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


ERROR MESSAGES:

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

Help would be greatly appreciated!
Thanks


#2

This statement should be part of ,

this one,

All one like,

original= raw_input("Enter a word:")

And here,

You are supposed to print original to the console not raw_input.

raw_input is a function and cannot be printed like a variable.


#3

Ah okay I see now, that does make more sense.
Thanks very much


#4

print 'Welcome to the Pig Latin Translator!'

Start coding here!

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

what am i doing wrong here


#5

You put quotes around original in here:

Even though it is not suppose to be a string. Remove them. Also you need quotes around empty in here:

Because it is suppose to be a string. That should fix your problem. :slight_smile:


#6

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