Python Lists and Dictionaries - Length


#1

Here's my code:

suitcase = []
suitcase.append("sunglasses")

Your code here!

suitcase.append("towel")
suitcase.append("sandals")
suitcase.append("clothes")

list_length = (3) # Set this to the length of suitcase

print 'There are' + list_length 'items in the suitcase'
print suitcase

I'm just stuck on what to do from here can someone help and explain what to do please thanks

Here's the link:

https://www.codecademy.com/courses/python-beginner-en-pwmb1/1/1?curriculum


#2

lets see, there following items are in our suitcase:

sunglasses
towel
sandals
clothes

yep, i also count 3 items :wink: we learned a function which can gives us the length of lists, remember? Maybe we should use it here

finally, here:

print 'There are' + list_length 'items in the suitcase'

there is a + after the variable name to concatenate string and variable


#3

@stetim94 Thanks you again :slight_smile


#5