General list index question


#1


s = "Charlie"

print s[0]

will print "C"

print s[1:4]

will print "har"

Why does print s[1:4] har instead of harl since the letter "l" is the 4th index in the list


Replace this line with your code.


#2
string[first_index_inclusive, last_index_exclusive]

string[0:0]    =>  ""

string[0:1]    =>  first character

#3

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