[Tutor] Dictionary Issue

Mark Lawrence breamoreboy at yahoo.co.uk
Fri Aug 7 01:53:29 CEST 2015


On 06/08/2015 20:05, Ltc Hotspot wrote:
> On my breath and soul, I did:
>
> Counter objects have a dictionary interface except that they return a zero
> count for missing items instead of raising a KeyError
> <https://docs.python.org/3/library/exceptions.html#KeyError>:

That's nice to know.  What do the rest of the methods on the class do?

>>>> Please don't top post here, it makes following long threads difficult.

What did you not understand about the above?

>> You obviously haven't bothered to read the link I gave you about the
>> Counter class so I give up.
>>

If you'd read the entire write up why are you still wasting time with a 
loop to find a maximum that simply doesn't work, when there is likely a 
solution in the Counter class right in front of your eyes?

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence



More information about the Tutor mailing list