我应该在Python dicts上使用'has_key()'或'in'吗?
我想知道做什么更好:
d = {'a': 1, 'b': 2}'a' in dTrue
要么:
d = {'a': 1, 'b': 2}d.has_key('a')True
PIPIONE
相关分类