A curious bit of code...
__peter__ at web.de
Thu Feb 13 22:06:31 CET 2014
Chris Angelico wrote:
> On Fri, Feb 14, 2014 at 7:55 AM, 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:
> .... AAAAAAAAAAAAAAAAAAARGGGGGGGGGGHHHH!
> Really, I actually did pause, double-take, and then scream under my
> breath, when I saw that. Yes, it works. But please, if you EVER do
> this, save me the trouble and just submit your code to thedailywtf.com
> straight away!
For the record:
>>> s = "x"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: slice step cannot be zero
More information about the Python-list