Please help, stuck on Late arrivals and List length


#1



Hello, i am STUCK. Put this code in and BOOM. NOTHING.

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

Your code here!

suitcase.append("socks")
suitcase.append("shirt")
suitcase.append("pants")

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


I don't specifaclly remember why it didn't work, but it said my code was right, then it gave me THIS!


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

PLEASE HELP, MABY THE ANSWER?:unamused::expressionless::sweat::pensive:


#2

They want you to use len() to your suitcase list here.


#3

How? What do you mean by that?


#4

If you want to find the length of a list, you can use the len() function.

The error message gave you an example on how to use this len() function. Except your list is not list_name but suitcase. Replace 4 with that in list_length = 4.


#5

Slight problem. That took the len() error out but added this error = Oops, try again. Your code looks a bit off. Check the Hint if you need help! Your code threw the following error: name 'list_name' is not defined.
Why Codecademy! WHY!!!!!!:tired_face::scream_cat:


#6

Never mind. Heh. Just glitch. Instead of list name i had to put "suitcase". So obveus, yet i never thought of it like that!:unamused:


#7

Haha the only list you have is suitcase not list_name. I mentioned that before :stuck_out_tongue:


#8

Very funny!!:laughing:


#9

Not really. :stuck_out_tongue_winking_eye:


#10

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