Ending Up


#1



How do I fix this???

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

It looks like new_word contains "underwooduay" instead of "nderwooduay"!


Replace this line with your code. 
pyg = '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)]
    print original
    
else:
    print 'empty'


#2

here:

new_word  [1:len(new_word)]

you take a slice of new_word, which you should store in new_word (in essence, updating the variable)


#3

This doesn't clear it up, at least for me.

This part is the slice:

new_word [1:len(new_word)]

So as a hint, you still need to set the variable new_word equal to this statement.


#4

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