Home

In message <1191286234.855980.118170@g4g2000hsf.googlegroups.com>, John
Machin wrote:

> On Oct 2, 6:27 am, brad <byte8b...@gmail.com> wrote:
>> Is this the correct way to slice the last 4 items from a list?
>>
>> x = [1,2,3,4,5,6,7,8,9]
>> print x[-4:]
>>
>> It works, but is it Pythonic?
>
> It's Pythonic. It's also unambiguous, unlike your specification, which
> could be interpreted as 'chop off the last 4 items from a list' ...

No, the OP is using "slice" in the technically correct CS sense.

previous
next

File Read Cache - How to purge?
Re: Module for mod_python
Re: How to detect read or write access to a user defined array?
Re: Something with static...
Re: Something in the function tutorial confused me.
Fundacja Avalon
Rodzic Po Ludzku
Mimo Wszystko
Akogo
Mam Marzenie