4/9 lesson error


so.... I'm back again, with another error. I really don't know why.
here's the code:

suitcase = []

Your code here!


list_length = 4 # Set this to the length of suitcase

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

I feel a bit stupid.


Hello, @k-nox.
The %s is used to place a value into that exact position on a string.
There's no such thing as %4 so try changing that to %s and your code will work.

Best regards,

Don't say such thing! This is coding, we're used to commit mistakes and LEARN from them!
You're doing a good job, buddy :slightly_smiling:


and here is the damn error:

Traceback (most recent call last):
File "python", line 11, in
ValueError: unsupported format character ' ' (0x20) at index 12


and now this one:

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


man, i love computing. this is one good reason i started to learn coding.


@k-nox: The problem is that the function len() returns the lenght of a list, dictionary, string and even tuples.
If you want to use lent() and get the size of your list and put into that string, you should do something like this:


Is it needed? No.
The lesson asked you to assign the value of the size of your list into list_lenght, all you have to do now is to :

print "Hey! Your list's lenght is %s !" % list_lenght


yeah... i passed it. i forgot to print the length of suitcase. such stupid, me....


It happens, Nox.
Don't worry so much about it!

Enjoy coding!

Best regards,


thanks mate! you too!