关于遍历字典删除其中的值
dic = {"a":1,"b":2} for a in dic: del dic[a]
这样会报错,解决方法如下:
for a in list(dic): del dic[a]