So Close - Just One Thing Missing!


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
    print new_word [1:len(new_word)]



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)


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