Schüle Daniel wrote:
> you are right, I didn't think about dictionaries
> >>> p = "complex(1-1e-%i, 1-1e-%i)"
> >>> d={}
> >>> [d.update({i:eval(p % (i,i))}) for i in range(20,30)]
> [None, None, None, None, None, None, None, None, None, None]
>
> so now the work is complete :)
>
> Regards
>
[...]
> If you think so :) Ususally people go for dictionaries in such cases.
you are right, I didn't think about dictionaries
>>> p = "complex(1-1e-%i, 1-1e-%i)"
>>> d={}
>>> [d.update({i:eval(p % (i,i))}) for i in range(20,30)]
[None, None, None, None, None, None, None, None, None, None]
s
Schüle Daniel wrote:
> Hello all,
>
> >>> p = "z%i = complex(1-1e-%i, 1-1e-%i)"
> >>> lst = [p % (i,i,i) for i in range(10, 30)]
> >>> for item in lst:
> ... exec item
> ...
> >>>
> >>> p = "z%i = complex(1-1e-%i, 1-1e-%i)"
> >>> lst = [p % (i,i,i) for i in range(10, 30)]
> >>> [exec i