Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Python by matiit ( 16 years ago )
>>> a = [1,1,1,1,5,5
... ]
>>> a
[1, 1, 1, 1, 5, 5]
>>> dict
<type 'dict'>
>>> [(x,a.count(x))for x in a]
[(1, 4), (1, 4), (1, 4), (1, 4), (5, 2), (5, 2)]
>>> z = [(x,a.count(x))for x in a]
>>> z
[(1, 4), (1, 4), (1, 4), (1, 4), (5, 2), (5, 2)]
>>> dict(z)
{1: 4, 5: 2}
>>>
Revise this Paste