On Wed, Sep 1, 2010 at 9:26 AM, Shashwat Anand wrote:
>
>
> On Wed, Sep 1, 2010 at 6:45 PM, Matt Saxton wrote:
>
>> On Wed, 1 Sep 2010 09:00:03 -0400
>> Victor Subervi wrote:
>>
>> > Hi;
>> > I have this code:
>> >
>> > cursor.execute('describe products;')
>> > cols = [item[0] for item in cu
Victor Subervi 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. Pl
On Wed, Sep 1, 2010 at 6:45 PM, Matt Saxton wrote:
> On Wed, 1 Sep 2010 09:00:03 -0400
> Victor Subervi wrote:
>
> > Hi;
> > I have this code:
> >
> > cursor.execute('describe products;')
> > cols = [item[0] for item in cursor]
> > cols = cols.reverse()
> > cols.append('Delete')
> > co
On Wed, Sep 1, 2010 at 9:17 AM, Shashank Singh <
shashank.sunny.si...@gmail.com> wrote:
> reverse reverses in-place
>
> >>> l = [1, 2, 3]
> >>> r = l.reverse()
> >>> r is None
> True
> >>> l
> [3, 2, 1]
> >>>
>
Ah. Thanks!
beno
--
http://mail.python.org/mailman/listinfo/python-list
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 wrote:
> Hi;
> I have this code:
>
> cursor.execute('describe products;')
> cols = [item[0] for item in cursor]
> cols = cols.reverse()
>
On Wed, 1 Sep 2010 09:00:03 -0400
Victor Subervi 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 pr