On 9/24/07, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Mon, 2007-09-24 at 16:53 +0530, Amit Khemka wrote: > > On 9/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: <snip> > > > > >>> l = ["1", "11", "2", "22"] > > >>> sorted(l, cmp = lambda x, y: cmp(int(x), int(y))) # provide your > > own compare function ! > > >>> l > > ['1', '2', '11', '22'] > > That interpreter session is a work of fiction, since sorted returns the > sorted list instead of sorting the list in place.
I am sorry, thanks for pointing out ! What I intended to write was: >>> l = sorted(l, cmp = lambda x, y: cmp(int(x), int(y))) Btw, It was more of a goofed up Reality show ! cheers, -- ---- Amit Khemka website: www.onyomo.com wap-site: www.owap.in -- http://mail.python.org/mailman/listinfo/python-list