<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>
<Below this line, add a link to the EXACT exercise that you are stuck at.>
I’m stuck on the exercise to print the the new word from the second character to the last.
<In what way does your code behave incorrectly? Include ALL error messages.>
I don’t think it should be from new_word[1:len(new_word)].
<What do you expect to happen instead?>
I think it should be from new_word[1:len(new_word)-1] instead because the last character in the word has an index of len(new_word)-1. Without the -1 it would be outside of scope.
pyg = ‘ay’
original = raw_input(‘Enter a word:’)
if len(original) > 0 and original.isalpha():
word = original.lower()
first = word
new_word = word + first + pyg
new_word = new_word[1:len(new_word)-1]
<do not remove the three backticks above>