int results
>
> Vince
>
>
> On Fri, Jun 19, 2009 at 8:55 AM, Joe Python wrote:
>
>> I have a generator as follows to do list calculations.
>>
>> *result = [(ListA[i] - ListB[i-1])/ListA[i] for i in range(len(ListA))]*
>>
>> The above generator, throws
I have a generator as follows to do list calculations.
*result = [(ListA[i] - ListB[i-1])/ListA[i] for i in range(len(ListA))]*
The above generator, throws '*ZeroDivisionError*' exception if ListA[i] =
0.
Is there a way to say 'Don't divide by ListA[i] if its equal to 0 (within
that statement)'.
Hi Pythonistas,
I have a large dictionary of dictionary (50,000+ keys) which has a structure
as follows:
DoD = {
'flintstones' : {
'husband' : "fred",
'pal' : "barney",
'income': 500,
},
'jetsons' : {
'husband' : "george",
'wif