Check yourself... Some more


print 'Welcome to the Pig Latin Translator!'

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

if len(original) > 0 and len(original).isalpha():
print original

print "empty"

What's wrong with my code? It gives me the error:

Traceback (most recent call last):
File "python", line 6, in
AttributeError: 'int' object has no attribute 'isalpha'

Anyone know why?


and now all of a sudden it worked?


It only works when I don't type any letters?


Couple of things are wrong with your code:

First delete this line:

You already have it under original. Also,

You are suppose to check if the user's input( aka original) contains all alphabetical letters, not if the length of it does. It should be:



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