Python Lists and Dictionaries - #4 - Late Arrivals and List Length


For my code, I keep getting an error that states: "object of type 'int' has no len()."

However, I did put the string method of len() in with the code, along with the statement of list_length. What I am I doing wrong?

suitcase = ["sunglasses", "bathing suit", "t-shirt", "pants"] 

suitcase.append("bathing suit")

list_length = len(4) 

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


HI why not putting the suitcase inside len() on this line instead of 4

list_length = len(4)

And remove everything you put inside suitcase

suitcase = ["sunglasses", "bathing suit", "t-shirt", "pants"]


Thanks! U the man! :joy:




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