inyeol.lee at siimage.com
Fri Feb 21 21:36:10 CET 2003
On Fri, Feb 21, 2003 at 08:18:03PM +0000, Michael P. Soulier wrote:
> I was wondering, is there no built-in way to pull values off and on to a
> list in python? append and pop are find if you are working with the right
> side, but if you need to work with both, having something like shift and
> unshift from perl would be nice.
> If I just need to simulate a stack, I'll reverse the list if need be, but
> sometimes I want to manipulate both sides.
>>> L = range(5)
[0, 1, 2, 3, 4]
>>> L.insert(0, -1)
[-1, 0, 1, 2, 3, 4]
More information about the Python-list