osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A curious bit of code...


In article <mailman.6880.1392324956.18130.python-list at python.org>,
 Emile van Sebille <emile at fenx.com> wrote:

> On 2/13/2014 11:59 AM, Zachary Ware wrote:
> > In a fit of curiosity, I did some timings:
> 
> Snip of lots of TMTOWTDT/TIMTOWTDI/whatever... timed examples :)
> 
> But I didn't see this one:
> 
> s[::len(s)-1]
> 
> Emile

I love it.  I need to add this to my list of Python trivia questions.