PygLatin Check Yourself


#1



I can't figure out what I am doing wrong on this section.. any hints?

Here is my code:

print 'Welcome to the Pig Latin Translator!'

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

This is the error I am getting:

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


#2

this two lines:

raw_input("Enter a word:")
original = raw_input

you can store the result of raw_input in original directly, so this should be one line of code.


#3

Store users input in a variable. Like this:

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

Check my profile if you need more help.


#4

Ah it makes sense now! Thanks both, really helped :slight_smile:


#5