List Slicing Help


ERROR: global name "first" is not defined

I expect to complete the lesson. the directions don't tell me to define a variable called first, middle, last

Replace this line with your code. 
suitcase = ["sunglasses", "hat", "passport", "laptop", "suit", "shoes"]

first  = suitcase[0:2] 
middle = suitcase[2:3]
last = [4:5]


Your first and middle has the format: suitcase[x:y]. Why is your last different?
Also, they want the first two, middle two, and last two. Your first is correct but the middle only gives one middle item. So is your last if you added suitcase to it.


OMG thank you so much! I need to stop doing that lol


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.