Check yourself some more, code passed but its wrong?


print 'Welcome to the Pig Latin Translator!'

raw_input("Enter a word:")
original = raw_input('Prompt')
if len(original) > 0 and original.isalpha():
print original

print "empty"

This is my code, since .isalpha() is in, that means any number will immediately get false, but if a put 0 in for example, it still works and my code passed, can anyone explain to me please? Also empty still comes up in the console despite inputting an answer in.


The above line may be removed.


Thank you, can I ask why? It was required for the previous test I think? Anything else I can modify to make the code better? I wish to learn everything about it.


All in good time. Continue with the track and practice each lesson. Soon you're be well enough informed to be able recognize code patterns, and be able to do essentially the same thing using different approaches. That will come.


I hope so, I feel like I am learning, but not enough to remember to code from the top of my mind.


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