J
Johan Hahn
Wouldn't it be nice if list.count, called without any arguments,
returned a dict with the list's unique items as keys and their
frequency of occurance as values?
....johahn
returned a dict with the list's unique items as keys and their
frequency of occurance as values?
{' ': 1, 'e': 1, 'd': 1, 'h': 1, 'l': 3, 'o': 2, 'r': 1, 'w': 1}[1,2,1,'a'].count() {'a': 1, 1: 2, 2: 1}
'hello world'.count()
....johahn