here is the code of PygLatin game :
# This is the first line of the program which holds the basic value of our game's # core letters "a and y" that gets stick upon the last of original letters!pyg = 'ay'# This line contains inputoriginal = raw_input('Enter a word:')# this one converts the user input to all small alphabetical charactersword = original.lower()# identifys that user input is not empty only alphabeticalif len(word) > 0 and word.isalpha(): # stores the first letter of the user input that is to be removerd first = word[0] # identifys if the first letter if vowel or consonant and print the type if first == 'a' and 'e' and 'i' and 'o' and 'u': print "This is a vowel." # this translates the word by slicing the input from letter 1 to end by # removing the first letter and bringing it to last and adding the 'pyg' # variable value which is the core of the game! new_word = word[1:] + word[0] + pyg print "Your Translated PygLatin Word is:" + new_word else: # this also translates the word by slicing the input from letter 1 to end by # removing the first letter and bringing it to last and adding the 'pyg' # variable value which is the core of the game! print "This is a Consonant." new_word = word[1:] + word[0] + pyg print "Your Translated PygLatin Word is:" + new_word else: print 'empty' i think it needs improvements...so please dont shy to reply! .........
you may try this in labs.codecademy.com