List Behavior when inserting new items

Drew olsonas at gmail.com
Mon Jan 29 13:57:36 EST 2007


I'm looking to add an element to list of items, however I'd like to 
add it at a specific index greater than the current size:

list = [1,2,3]
list.insert(10,4)

What I'd like to see is something like:

[1,2,3,,,,,,4]

However I see:

[1,2,3,4]

Is there any way to produce this kind of behavior easily?

Thanks,
Drew




More information about the Python-list mailing list