Pyg Latin: Checking yourself some more


#1



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


Welcome to the Pig Latin Translator!
Enter a word wrods
Traceback (most recent call last):
File "python", line 5, in
TypeError: object of type 'builtin_function_or_method' has no len()


Looks like it removed my indents when I posted. I have the If/print indented properly. Not sure why it is giving this error


print 'Welcome to the Pig Latin Translator!'

raw_input ("Enter a word")
original = raw_input
if len(original) > 0 and original.isalpha():
    print original
else:
    print "no words".


#2

Cancel, I figured it out. I wasn't assigning raw_input as original in the correct way


#3

Something isn't right about this.

Maybe you intend to put it as:

original = raw_input ("Enter a word")

That said, it should just be:

original = ""

#4

Oops! Okay... :slight_smile:


#5

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