All pastes #553482 Raw Edit

Unnamed

public python v1 · immutable
·published 2007-06-09 18:54 UTC
rendered paste body
>>> d{1: 4, 2: 1, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 3, 9: 1}>>> l = ['x', 'x', 'x', 'y', 'y', None, None, None]>>> d = {}>>> for i in set(l):...   d[i] = l.count(i)...>>> d{'y': 2, 'x': 3, None: 3}