Not Understanding Why it Works This Way


#1



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


Not understanding why it works this way


I have already completed the entire thing but I don't understand why the code new_word= new_word[1:len(new_word)] works the way it does, but I understand everything before it. Please Help


pyg = 'ay'
original = raw_input('Enter a word:')
if len(original) > 0 and original.isalpha():
    word=original.lower()
    first=word[0]
    new_word= word + first + pyg
    new_word= new_word[1:len(new_word)]
    print original  
    print word
    print new_word
else:
    print 'empty'


#2

But why do you not understand how new_word= new_word[1:len(new_word)] works? How do you think it works?


#3

I know that len(new_word) takes the length of the new word but I don't understand what the 1: is there for, are we taking the second letter of the new word or what?


#4

we want to out the first letter (is cool for our translation) so we want to get from the second letter (index 1) till end of of new_word


#5

ohhhh I get it now, thanks a ton


#6