0

Took a Python class a few months ago so im a little rusty

lst= ["A", "B", "C", 2, 9 ]
    #  0,   1,   2 , 3, 4

print(lst[0:4])
# ['A', 'B', 'C', 2]

Why does the last 9 not get included in this? Shouldn't the 0:4 index the list from zero to the last digit because the 4 on the bottom which shows the index number represents the 4th character in the list??

Mark
  • 90,562
  • 7
  • 108
  • 148

0 Answers0