Dict Comprehension ?

Ernst-Ludwig Brust seinnixgud at online.de
Tue Oct 7 04:25:01 EDT 2008


<pruebauno at latinmail.com> schrieb im Newsbeitrag 
news:7cfd6944-955b-4f23-99f9-d52615abd909 at 75g2000hso.googlegroups.com...
>
> from collections import defaultdict
> da=defaultdict(int)
> for x in [10]:
>    for y in [11]:
>        da[abs(x-y)]+=1

Thangs,
collections are a real good idea.
I will use this version.

Ernsst-Ludwwig Brust





More information about the Python-list mailing list