‘dict’ object has no attribute 'has_key'

由python2.7 代码更改成python3.5 时 dict 数据类型报错python

产生缘由: dict.has_key()  ; python3 中删除了该方法python2.7

解决方法:  使用 code

if key in dict : 更改成 if dict.has_key(key):
相关文章
相关标签/搜索