Skip to content
loading...

re: defaultdicts: Never Check If a Key is Present Again! VIEW POST

TOP OF THREAD FULL DISCUSSION
re: If you're covering collections, why not also give a quick mention to Counter? from collections import Counter grades = ["A", "A", "B", "C", "D"...
 

You're right! I wanted to dedicate another article to Counter. There's too much goodness for just a quick blurb :)

(From the article:)

There's a lot more goodies in there (not least of which is the actual Counter class which takes care of our very problem here. But, again, that's for another PSL article).

 

Nice one, that's what I get for skimming the article and rushing to reply.

code of conduct - report abuse