I need help with a problem I have... I have to make a python pyglatin translator as a test project and I'm stuck and puzzled look
pyg = 'ay'
original = raw_input('Enter a word:')
word = original.lower()
first = word[0]
new_word = word
sliceword = new_word[1:6]
if len(original) > 0 and original.isalpha():
if first == 'a' or first == 'e' or first == 'i' or first == 'o' or first == 'u':
new_word = word + pyg
print (new_word)
else:
new_word = sliceword + pyg
print (new_word)
else:
print ('Enter something valid please...')
look at the course if you want, it's free
http://www.codecademy.com/courses/python-beginner-2W5v7/1/5?curriculum_id=4f89dab3d788890003000096I need to do
Inside the else part of your if/else block that checks the first letter of the word, set the new_word variable equal to the translation result for a word that starts with a consonant.
Replace the print 'consonant' bit with print new_word. Make sure to test your code with a word that starts with a consonant!
The code is left unfinished, but I need all constant words to be like... google = ooglegay
I'm trying to slice the string, but can't seem to find a way to fit it in >:/. Any Ideas?
And I posted this in the off topic page because the coding help section is for torque only...