inserting into a list

John Salerno johnjsal at
Tue Mar 7 17:02:38 CET 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