python 字典格式嵌套,相同项做叠加
摘要:
all_dict = {} for tg_id in ['com.qq_a','com.qq_b','com.qq_c','com.qq_c']: tmp_dict = all_dict.get(tg_id,{'times':0}) tmp_dict['times'] += 123 all_dict[tg_id] = tmp_dict print(all_dict)... 阅读全文
posted @ 2018-04-02 21:22 星河赵 阅读(374) 评论(0) 推荐(0)
浙公网安备 33010602011771号