I have read these post 1, 2, 3, but I still can not figure out following python code:
>>> s = 'mississippi'
>>> d = defaultdict(int)
>>> for k in s:
... d[k] += 1
...
>>> lis = ['m', 'i', 's', 'p']
>>> max(lis, key=d.get)
'i'
I know the times that a letter occurs stored in d. And when I input:
>>> d.get
<built-in method get of collections.defaultdict object at 0x7f506ed8d710>
It said that get is a method. Why it dose not use parenthesis? And what kind of data form it returns?