List Slicing help!


I dont know what is wrong here is my code if anyone is able to help
also I get this error"t looks like your last slice is ["laptop", "suit"] instead of ["suit", "shoes"]."

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

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



last   = suitcase[3:5]

are you sure that [3:5] will give you the last two items?


I just fixed that and now its saying
"It looks like your middle slice is ["passport"] instead of ["passport", "laptop"]."


there was nothing wrong with your middle slice? so the fix you applied, didn't fix anything


yeah, I tried to fix the last slice and messed up the middle some how


so you undo the change to your middle:

middle = suitcase[2:4]

and instead focus on fixing last


I just fixed it by making the last slice
last = suitcase[3:6] and that worked for some reason


does using last = suitcase[3:6] make sense? this will get you the last three items, not the last two items


your right of course so I changed it to
last= suitcase[4:6]


Do you also understand list slicing or do you have questions about it?


I'm pretty sure that I understand it
Thank you!