Re: Python Question - How to show the last few elements in a list

2007-11-20 Thread Greg
Todd, Yep..it worked. request.session['prod'][-7:]. Thanks On Nov 20, 9:56 pm, "Todd O'Bryan" <[EMAIL PROTECTED]> wrote: > Have you tried request.session['prod'][-7:] ? > > If that doesn't work, try list(request.session['prod'])[-7:] > > Todd > > On Nov 20, 2007 10:52 PM, Greg <[EMAIL PROTECTED

Re: Python Question - How to show the last few elements in a list

2007-11-20 Thread Todd O'Bryan
Have you tried request.session['prod'][-7:] ? If that doesn't work, try list(request.session['prod'])[-7:] Todd On Nov 20, 2007 10:52 PM, Greg <[EMAIL PROTECTED]> wrote: > > Hello, > I have a session variable. Whenever anybody adds a product to this > session variable it gets stored like so: >

Python Question - How to show the last few elements in a list

2007-11-20 Thread Greg
Hello, I have a session variable. Whenever anybody adds a product to this session variable it gets stored like so: request.session['prod'].append(b) This can make my session variable look like this: [, , , ] // I want to show the last 7 elements in my list, Occassionally my list