Ending Up Ch 10


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

When I click submit code, it is OK, but when I enter a word in the console, it gives the error:

Traceback (most recent call last):
File "python", line 9, in
TypeError: slice indices must be integers or None or have an index method

Ï want to apply the method described in the instructions.

pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
    print new_word
    print 'empty'


you want to the slice till the end of new_word, in other words the length (len()) of new_word.


that is also possible.