python dict increment key code example Example: python one line key increment or add my_dict[key] = my_dict.get(key, 0) + 1