On 2017-06-13, Peter Otten <__pete...@web.de> wrote:
> Grant Edwards wrote:
>
>> On 2017-06-13, Peter Otten <__pete...@web.de> wrote:
>>
def edges(items): # where items is a non-empty iterator
first = next(items)
last = functools.reduce(sekond, items, first)
return
Grant Edwards wrote:
> On 2017-06-13, Peter Otten <__pete...@web.de> wrote:
>
>>> def edges(items): # where items is a non-empty iterator
>>> first = next(items)
>>> last = functools.reduce(sekond, items, first)
>>> return [first, last]
>>>
>>> Of course, right?
>>
>> Yeah, reduce()
On 2017-06-13, Peter Otten <__pete...@web.de> wrote:
>> def edges(items): # where items is a non-empty iterator
>> first = next(items)
>> last = functools.reduce(sekond, items, first)
>> return [first, last]
>>
>> Of course, right?
>
> Yeah, reduce() is certainly the cherry on the ite
Jussi Piitulainen wrote:
> Peter Otten writes:
>
> ...
>
>> def edges(items):
>> first = last = next(items)
>> for last in items:
>> pass
>> return [first, last]
>
> ...
>
>> However, this is infested with for loops. Therefore
>
> ...
>
>> I don't immediately see what to
On Monday, June 12, 2017 at 7:33:03 PM UTC+1, José Manuel Suárez Sierra wrote:
> Hello,
> I am stuck with a (perhaps) easy problem, I hope someone can help me:
>
> My problem is:
> I have a list of lists like this one:
> [[55, 56, 57, 58, 83, 84, 85, 86, 89, 90, 91, 92, 107, 108, 109, 110, 111,
>
Peter Otten writes:
...
> def edges(items):
> first = last = next(items)
> for last in items:
> pass
> return [first, last]
...
> However, this is infested with for loops. Therefore
...
> I don't immediately see what to do about the for loop in edges(), so
> I'll use the t
Jussi Piitulainen wrote:
> breamore...@gmail.com writes:
>
>> On Monday, June 12, 2017 at 7:33:03 PM UTC+1, José Manuel Suárez Sierra
>> wrote:
>>> Hello,
>>> I am stuck with a (perhaps) easy problem, I hope someone can help me:
>>>
>>> My problem is:
>>> I have a list of lists like this one:
>>
breamore...@gmail.com writes:
> On Monday, June 12, 2017 at 7:33:03 PM UTC+1, José Manuel Suárez Sierra wrote:
>> Hello,
>> I am stuck with a (perhaps) easy problem, I hope someone can help me:
>>
>> My problem is:
>> I have a list of lists like this one:
>> [[55, 56, 57, 58, 83, 84, 85, 86, 89,
On 12/06/17 20:32, José Manuel Suárez Sierra wrote:
> Hello,
> I am stuck with a (perhaps) easy problem, I hope someone can help me:
>
> My problem is:
> I have a list of lists like this one:
> [[55, 56, 57, 58, 83, 84, 85, 86, 89, 90, 91, 92, 107, 108, 109, 110, 111,
> 117, 118, 119, 120, 128, 1
On 2017-06-12 19:32, José Manuel Suárez Sierra wrote:
Hello,
I am stuck with a (perhaps) easy problem, I hope someone can help me:
My problem is:
I have a list of lists like this one:
[[55, 56, 57, 58, 83, 84, 85, 86, 89, 90, 91, 92, 107, 108, 109, 110, 111, 117,
118, 119, 120, 128, 129, 130, 1
Hello,
I am stuck with a (perhaps) easy problem, I hope someone can help me:
My problem is:
I have a list of lists like this one:
[[55, 56, 57, 58, 83, 84, 85, 86, 89, 90, 91, 92, 107, 108, 109, 110, 111, 117,
118, 119, 120, 128, 129, 130, 131, 135, 136, 137, 138, 184, 185, 186, 187, 216,
217, 2
11 matches
Mail list logo