Arithmetic with Boolean values

Bernd Nawothnig Bernd.Nawothnig at t-online.de
Sun Aug 12 13:21:06 EDT 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]



More information about the Python-list mailing list