Why isn't my code working?



every time I go to enter a number that not alphabetical it still returns that number instead of leaving it empty like the exercise is showing

I expect it not to return the number I entered because it's not alphabetical

**Here is my code**

print 'Welcome to the Pig Latin Translator!'

# Start coding here!
original = raw_input('Enter a word:')
print original
if original.isalpha() and len(original) >0:
    print original
    print "empty"


your line after your raw_input code, will ALWAYS print whatever you enter, then after that you have your IF statement, which will print "empty" if you enter anything else than a string.


Duh. Thanks for the help!


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