List slicing


what am I doing wrong? it says Did you remember to assign a sliced list to all three variables? Your code caused the following error: global name 'first' is not defined

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[4:6] # The last two items (index four and five)


i don't know what you did, but i would rewrite line1. For some reason, it is not typing where it should, but i can't figure out what it is. Whatever you did, it is also responsible for the error.

You seem to have entered 127, a del character. It causes the error (credit to jonatan for finding it)

Rewrite the first line to make it go away