vijay wrote:
Check out this code
 l= [1, 2, 3, 3, 4]
 d={}
 for item in l:
     d.setdefaut(item,0)
     d[item] +=1
print d
{1: 1, 2: 1, 3: 2, 4: 1}


with regard's
vijay


Thanks.  Very interesting concept.

Ken
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to