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