Ending up



<In what way does your code behave incorrectly? Include ALL error message
new word_contains "wordway" instead of "ordway"

Replace this line with your code.


the exercise url is the same for everyone, please copy paste your code to the forum


yg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
word = original.lower()
first = word[0]
new_word = word + first + pyg
new_word [1:len(new_word)] + first + pyg
print original
print 'empty'


first you create new_word variable:

new_word = word + first + pyg

then you should take a slice, and store this again in new_word (updating the variable)

now new_word contains the correct pyglatin version, now print new_word


could you show me how to set up the slice.


you did this successfully:

new_word [1:len(new_word)]

now all you need to do is store the slice in new_word (which will update the variable)


That worked! Thank you!


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