Late Arrivals and List Length


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

Why doesn't just inputting 4 work?

Replace this line with your code. 
suitcase = [] 

# Your code here!

list_length = 4
# Set this to the length of suitcase

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


Because the lesson asks us to use the len() function to query the list length. That is how it is done in a program. If we use literals then the list cannot be altered. Length is dynamic, just as the list is. It increases and decreases as the list grows and shrinks.


Cool. Great explanation. Thanks for your help.


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