Hi, guys! My code is working, but i want to improve it. Now this code is "translating" the word even if it haves digits or spaces, but i want to make an error message if user enters a word with spaces or digits, and ask him to re-enter the word without spaces and digits. Then, if all is correct, code must to "translate" the word.
Sorry for bad english, i'm not native speaker : D
Here it is:
print 'Welcome to the Pig Latin Translator!' original = raw_input("Enter a word:") if len(original) > 0 and original.isalpha(): print original elif original.isdigit(): print "Words are contains letters, dude!" else: print "Don't use numbers or spaces, bro!" pyg = 'ay' word = original.lower() first=word new_word=word[1:] + first + pyg print new_word