Python dictionary: add or increment entry
- by cursa
Hi everyone,
I'm currently re-engaging with Python after a long absence and loving it. However, I find myself coming across a pattern over and over. I keep thinking that there must be a better way to express what I want and that I'm probably doing it the wrong way.
The code that I'm writing is in the following form:
# foo is a dictionary
if…