Object has no attribute 'isalpha' {line 6}


Welcome to the Pig Latin Translator!
Enter your name caolan
Traceback (most recent call last):
  File "python", line 6, in <module>
AttributeError: 'builtin_function_or_method' object has no attribute 'isalpha' 
Code below

print 'Welcome to the Pig Latin Translator!'

# Start coding here!
raw_input("Enter your name")
original = raw_input 
if (original) > 0 and original.isalpha():
    print original
    print "empty"


is the name of the function. Nothing is invoked. What this line does is copy the function to original. Remove the line above it, and include the invocation in this line.

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

Now origial will be a string, not a function.


Got it solved, Thank you very much. I was far from understanding why I would have to add ("Enter a word to translate: ") but now after reading over this a few times I understand. :grin:


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