inserting into a list

John Salerno johnjsal at NOSPAMgmail.com
Tue Mar 7 11:02:38 EST 2006


Christoph Haas wrote:

> L[2:2]=[3]

I'm still a little confused about this. If what I'm inserting is just an 
integer, why wouldn't

L[2:2] = 3

work? What if you wanted to insert an actual list into that slot? Would 
you have to wrap it in double brackets?



More information about the Python-list mailing list