Python3对字典操作时遇到错误:dictionary changed size during iteration
错误的代码:a={'a':1,'b':0,'c':1,'d':0}forkeyina.keys():dela[key]参考资料:https://www.python.org/dev/peps/pep-0234/大概是说字典在遍历时不能进行修改,建议转成列表或集合处理。所以,正确的代码:a={'a':1,'b':0,'c':1,'d':0}forkeyinlist(a.keys()):dela[ke