4. Late Arrivals & List Length


#1



My exercise link


This is what I get.
Oops, try again. Remember: len(list_name) will return the length of a list as an integer.

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

# Your code here!
suitcase.append("Shirt")
suitcase.append("Shorts")
suitcase.append("Underwear")

list_length = 4 # Set this to the length of suitcase

print "There are %d items in the suitcase." % (list_length)
print suitcase

What does that mean? Thanks!


#2

That error message seems to be suggesting that you should use the function len in some way, and the instructions probably have something similar to say.
How does that compare to your code? What are the instructions asking you to do with len?


#3

Length is a dynamic property of a string or a list.

We should never specify it as a fixed literal, ever.

Always query the length property.

list_length = len(suitcase)