List Slicing


#1



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

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


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)


#2

this line:

middle = suitcase[2:3]

it is lesser then 3, so this will put the item at index 2. You need item at index 2 and 3, so you might want to use 4


#3

Oh, I missed that. thanks.
Also
last = suitcase[4:6]


#4

of course, but i was sure you where clever enough to figure suitcases out yourself :slight_smile: