List Slicing


#1

I couldn't figure out what's wrong with my code. I need some help


#2

see slicing as a loop, for example in first it slices from zero till lesser then 1. (so only 0)

you need to use two instead:

suitcases[0:2]

0 till lesser then 2 are indexes zero and one, exactly as you want

You have lesser then (<) and lesser or equal (<=), the slicing uses lesser then, so if you have:

[0:4]

4 is not included


#3

Thank you very much. It works


#4