5/14: List Slicing


#1

Here is my code. I'm not entirely sure what I'm doing wrong here.

suitcase = ["sunglasses", "hat", "passport", "laptop", "suit", "shoes"]

first = suitcase[0:2] # The first and second items (index zero and one)
middle = suitcase[2:3] # Third and fourth items (index two and three)
last = suitcase[4:5] # The last two items (index four and five)

Error Message: Oops, try again. It looks like your middle slice is ["passport"] instead of ["passport", "laptop"].


#2

print middle

print last

add these to your code and you will that you did not slice enough


#3

thanks man :smile:

..............................................................................................................................................