Python3报错:AttributeError: 'dict' object has no attribute 'has_key'
出现这种错误是因为python版本兼容问题:has_key方法在Python2中方法,在Python3没有
如:
loc_dict.has_key(location)
改为:
if location in loc_dict
Python3报错:AttributeError: 'dict' object has no attribute 'has_key'
出现这种错误是因为python版本兼容问题:has_key方法在Python2中方法,在Python3没有
如:
loc_dict.has_key(location)
改为:
if location in loc_dict