Late Arrivals & List Length seems wrong in the console


#1

Hello,

I did the right thing (I think) and I can start the next lesson.
However the result seems wrong in the console:

There are 1 items in the suitcase.
['sunglasses', 'short', 'tie', 'polo']
None

My code:

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

Your code here!

suitcase.append("short")
suitcase.append("tie")
suitcase.append("polo")

list_length = [3] # Set this to the length of suitcase

The result should be 4 items and not 1 in the console, no?


#2

To find length of list(number of items), We use len() function.
We pass our list to len() function and it returns the number of items.

Here our list is suitcase
If you want to save the number/length.
Save it to a variable, Its list_length here.


#3

Ah ok, thanks for your answer :slight_smile:


#4

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