Ending up


#1



https://www.codecademy.com/courses/python-beginner-2W5v7/1/4?curriculum_id=4f89dab3d788890003000096#

<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.


#2

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


#3

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
else:
print 'empty'


#4

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


#5

could you show me how to set up the slice.


#6

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)


#7

That worked! Thank you!


#8

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