use dict.get() to increase valuetimknip (60)in #note-timknip • 4 years ago a_dict = {"a":1} a_dict["b"] = a_dict.get("b", 0) + 1 print(a_dict) > {'a': 1, 'b': 1} a_dict["a"] = a_dict.get("a", 0) + 1 print(a_dict) > {'a': 2, 'b': 1} #dict #python