Velocity Reviews > Arithmetic with Boolean values

# Arithmetic with Boolean values

Paul Rubin
Guest
Posts: n/a

 08-12-2012
> which can be simplified to:
> for x in range(len(L)//2 + len(L)%2):

for x in range(sum(divmod(len(L), 2))): ...

Bernd Nawothnig
Guest
Posts: n/a

 08-12-2012
On 2012-08-12, Paul Rubin wrote:
>> which can be simplified to:
>> for x in range(len(L)//2 + len(L)%2):

>
> for x in range(sum(divmod(len(L), 2))): ...

nice solution.

Bernd

--
"Die Antisemiten vergeben es den Juden nicht, dass die Juden Geist
haben - und Geld." [Friedrich Nietzsche]

Mark Lawrence
Guest
Posts: n/a

 08-12-2012
On 12/08/2012 17:59, Paul Rubin wrote:
>> which can be simplified to:
>> for x in range(len(L)//2 + len(L)%2):

>
> for x in range(sum(divmod(len(L), 2))): ...
>

So who's going to be first in with "and thou shalt not count to 4..."?

--
Cheers.

Mark Lawrence.

Roy Smith
Guest
Posts: n/a

 08-12-2012
In article <(E-Mail Removed)>,
Mark Lawrence <(E-Mail Removed)> wrote:

> On 12/08/2012 17:59, Paul Rubin wrote:
> >> which can be simplified to:
> >> for x in range(len(L)//2 + len(L)%2):

> >
> > for x in range(sum(divmod(len(L), 2))): ...
> >

>
> So who's going to be first in with "and thou shalt not count to 4..."?

You, apparently.

Gene Heskett
Guest
Posts: n/a

 08-13-2012
On Sunday 12 August 2012 20:27:13 Alister did opine:

> On Sun, 12 Aug 2012 19:20:26 +0100, Mark Lawrence wrote:
> > On 12/08/2012 17:59, Paul Rubin wrote:
> >>> which can be simplified to:
> >>
> >>> for x in range(len(L)//2 + len(L)%2):
> >> for x in range(sum(divmod(len(L), 2))): ...

> >
> > So who's going to be first in with "and thou shalt not count to 4..."?

>
> Five is right out

Can some smart ass (like me) suggest 69!

If it doesn't get summarily tossed, it could take a week or so to run.

Cheers, Gene
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page: <http://coyoteden.dyndns-free.com:85/gene> is up!
e-credibility: the non-guaranteeable likelihood that the electronic data
you're seeing is genuine rather than somebody's made-up crap.
-- Karl Lehenbauer

Hans Mulder
Guest
Posts: n/a

 08-14-2012
On 12/08/12 22:13:20, Alister wrote:
> On Sun, 12 Aug 2012 19:20:26 +0100, Mark Lawrence wrote:
>
>> On 12/08/2012 17:59, Paul Rubin wrote:
>>>> which can be simplified to:
>>>> for x in range(len(L)//2 + len(L)%2):
>>>
>>> for x in range(sum(divmod(len(L), 2))): ...
>>>
>>>

>> So who's going to be first in with "and thou shalt not count to 4..."?

>
> Five is right out

Neither count thou two, excepting that thou then proceed to three

-- HansM