A query about list

Santanu Chatterjee santanu at softhome.net
Thu Oct 9 17:28:25 EDT 2003


On Thu, 09 Oct 2003 21:19:18 +0000, Dave Benjamin wrote:

> In article <pan.2003.10.09.21.16.17.434674 at softhome.net>, Santanu
> Chatterjee wrote:
>> I was trying something like a.insert(1,a.pop(1)) but I need to modify
>> a.pop(1) somehow so that the brackets vanish ...you know what I mean. Is
>> that possible ?
> 
> Ahh, I see what you mean, now. You probably want slice assignment.
> 
> Try, for starters:
> a[1:2] = a[1]
> 
> You'll probably still need to use type().

Yes, this is what I wanted.
Thanks for this simple solution.

Regards,
Santanu




More information about the Python-list mailing list