On Tue, Oct 21, 2008 at 5:09 PM, Sander Sweers <[EMAIL PROTECTED]> wrote:

> This did not work but the below did ;-)
> templist = [ somelist[:1] + [x] + somelist[3:] for x in somelist[2] ]

somelist[:1] doesn't include somelist[1] so I think you are missing
one element of your original list.

List slices like [0:2] or [:1] are up-to-but-not-including the second index.

Kent
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to