字典:
-
has_key方法在python2中是可以使用的,在python3中删除了。
比如:if dict.has_key(key):
改为:
if key in dict:
在Python3中使用 dict.has_key(key) 报错为 ‘dict’ object has no attribute ‘has_key’
待续中。。。。
字典:
has_key方法在python2中是可以使用的,在python3中删除了。
比如:
if dict.has_key(key):
改为:
if key in dict:
在Python3中使用 dict.has_key(key) 报错为 ‘dict’ object has no attribute ‘has_key’
待续中。。。。