John Salerno wrote: > 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?
Because a slice represents a list - even if it is a one-elemented one. So, replacing it you need another list. > What if you wanted to insert an actual list into that slot? Would > you have to wrap it in double brackets? Why don't you just _try_ that? It would have been way faster than to ask questions you can easily answer yourself. Diez -- http://mail.python.org/mailman/listinfo/python-list