4/14 Please Help :)


#1

ASAP Because Im At School :relaxed:

Error On Line 10? list_length = append()

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

suitcase.append("teapot")
suitcase.append("the kids")

list_length = append()

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


#2

Why are you printing this?

list_length = append()
print "There are %s items in the suitcase." % (list_length)

It should be something like,

print "There are %s items in the suitcase." % len(suitcase) # You don't need parentheses if it only has one argument

Then you can also do this,

print("The items in the Suitcase are: %s" % *suitcase)

When you put a * infront of a variable that contains a list it unpacks all the data, you can use this to print the whole thing out. Also you can just add it with out the * and it will print the whole list out.


#3

It Still Doesn't Work, Could You Maybe Insert That Into The Text I Already Have? Thanks.


#4

Well these are the instructions for that particular course,

On lines 5, 6, and 7, append three more items to the suitcase list, just like the second line of the example above. (Maybe bring a bathing suit?) 

Then, set list_length equal to the length of the suitcase list.

They do want you to create 3 new items and append them, then they want a new variable that holds the len of the list.

suitcase.append("thong")
suitcase.append("g-string")
suitcase.append("chicken")


list_length = len(suitcase)

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

#5

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

Your code here!

suitcase.append("doll")
suitcase.append("ball")
suitcase.append("comb")

list_length = len(suitcase) # Set this to the length of suitcase

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


#6

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

suitcase.append("shirts")
suitcase.append("pants")
suitcase.append("money")

list_length = len(suitcase)

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