So Close - Just One Thing Missing!


#1



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


This is the error message I get:
Oops, try again. It looks like new_word contains "wordway" instead of "ordway"!


I keep changing things up but I can't pinpoint what to edit to get the result. Not sure how to take the "w" out.


pyg = 'ay'

original = raw_input('Enter a word:')

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


#2

here:

print new_word [1:len(new_word)]

you print the slice of new_word, however, you should first take the slice, store it in new_word (updating the variable), and then print new_word

also, else runs when the user input is invalid, so print something to let the user know there input is invalid, and the string slicing should be part of the if clause (at the end)


#4

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