Not really sure what im meant to be doing


#1

i typed in my code:

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

Your code here!

suitcase.append("cynide")
suitcase.append("poison")
suitcase.append("flick knife")

list_length = 4 # Set this to the length of suitcase

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

and it replied correctly in the window saying:

There are 4 items in the suitcase.

but codeacdemy wants me to do this:

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

and im not really sure what im meant to do!


#2

See here, what you've done is you've counted the amount of items (you, personally, not Python), which is four, and just said that there are four items. But what if you then add another item to the list? Then there will be five items, but your code will still just print "There are 4 items in the suitcase."

They want you to use "len(list_name)" in place of "4", which will return the amount of items in the Suitcase list, so that if the amount of items changes, then the phrase that is printed will be updated accordingly.


#3

Thank you i though it had something to do with len but I didn't relise i had to put the varible in as an argument!