s = "Charlie"
will print "C"
will print "har"
using s[1:4]. This returns everything from the letter at position 1 up till position 4.
Question 1, har in Charlie is letter 1,2,3. Why did it say position 1 up till position 4, shouldn't "l" also be included?
Question 2, I follow the instruction to "Set new_word equal to the slice from the 1st index all the way to the end of new_word. Use [1:len(new_word)] to do this." and console returns "Oops, try again. It looks like you printed the correct translation of "larry", but make sure to set new_word equal to the slice as well." What am I missing here?
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 print new_word[1:len(new_word)] print original else: print 'empty'