Slicing Arrays in this way

Tobiah toby at tobiah.org
Thu May 3 14:44:22 EDT 2007


John Machin wrote:
> On May 3, 8:55 am, Steven D'Aprano
> <s... at REMOVE.THIS.cybersource.com.au> wrote:
>> On Wed, 02 May 2007 15:03:24 -0700, Tobiah wrote:
>>
>>>  >>> elegant_solution([1,2,3,4,5,6,7,8,9,10])
>>> [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]]
>> Wow! That's impressive. What version of Python are you using? When I try
>> it, I get this:
>>
>>>>> elegant_solution([1,2,3,4,5,6,7,8,9,10])
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in <module>
>> NameError: name 'elegant_solution' is not defined
>>
> 
> The OP has already confessed. Don't rub it in.
> 

Well, my first post made perfect sense.  My 'confession'
involved noticing that I had replied to one respondent
saying that I wanted something more concise, while
praising the aptness of the same solution to the next
poster.  Lack of oxygen, I think.

-- 
Posted via a free Usenet account from http://www.teranews.com




More information about the Python-list mailing list