dict to boolean expression, how to?

Steven D'Aprano steve+comp.lang.python at pearwood.info
Fri Aug 1 12:35:03 EDT 2014


On Fri, 01 Aug 2014 16:50:51 +0100, Mark Lawrence wrote:

>> which can be simplified to:
>>
>> flag = any( cond[c] == 1 and cond[c.upper()] for c in ['a', 'b', 'c'] )
>>
>>
> Shouldn't that be cond[c.upper()] == 0 ?

Yes it should be, thank you!


-- 
Steven



More information about the Python-list mailing list