I'm almost confident there is a more Pythonic way of writing this code. The goal here is to increase a dictionary value by 1 or create the entry if it doesn't exist. My current code is:
#!python3
DICT = {}
if 'KEY' not in DICT:
DICT['KEY'] = 1
else:
DICT['KEY'] += 1
I would have sworn that there was a manner of consolidating this into a single line without the need for if/else.
Thanks!