initializing list with number of elements given by a variable

Oliver Pust oliver.pust at web.de
Thu Apr 11 05:22:46 EDT 2002


Hi,

I need to create a list which number of elements is given by an integer 
variable.

So something like this:

 >>> length_of_list = 6
 >>> list = ????????? # what to place here, is the question
 >>> print list
 >>> [0,0,0,0,0,0]    # the resulting list should look like this

Can anybody help me here?

Thanks,
	Oliver




More information about the Python-list mailing list