reverse reverses in-place >>> l = [1, 2, 3] >>> r = l.reverse() >>> r is None True >>> l [3, 2, 1] >>>
On Wed, Sep 1, 2010 at 6:30 PM, Victor Subervi <victorsube...@gmail.com>wrote: > Hi; > I have this code: > > cursor.execute('describe products;') > cols = [item[0] for item in cursor] > cols = cols.reverse() > cols.append('Delete') > cols = cols.reverse() > > Unfortunately, the list doesn't reverse. If I print cols after the first > reverse(), it prints None. Please advise. Also, is there a way to append to > the front of the list directly? > TIA, > beno > > -- > http://mail.python.org/mailman/listinfo/python-list > > -- Regards Shashank Singh Senior Undergraduate, Department of Computer Science and Engineering Indian Institute of Technology Bombay shashank.sunny.si...@gmail.com http://www.cse.iitb.ac.in/~shashanksingh
-- http://mail.python.org/mailman/listinfo/python-list