persondic={1:'a',2:'b',3:'c'}counts={}lst=[[1,2,3],[3,2,1],[1,3,2],[1,2,3]]for i in lst: ckey=persondic[i[0]] counts[ckey]=counts.get(ckey,0)+1for v in persondic.values(): print v,'=',counts.get(v,0)
python2.7