The code is behaving, although I would like to know how to tell user to re-enter a word if it is invalid. Right now it appears as though the code only points out when input is invalid, however the user has no way of returning to input a valid response. How can I go about doing this?
I have personalized some of the responses and added a name input for the heck of it, which is where I notice the problem. If say, I type in an invalid name, there is no way of correcting it, the program simply moves on to the "Enter a word" prompt.
print 'Welcome to the Pig Latin Translator!' name = raw_input("What's your name?") if len(name) > 0 and name.isalpha(): print name else: print "Invalid" original = raw_input("Enter a word:") if len(original) > 0 and original.isalpha(): print original else: print "Invalid"