麥大叔年歲大了 打算讓女兒接手
python - 'has_key()' or 'in'? - Stack Overflow 麥大叔年歲大了,打算讓女兒接手 I wonder what is better to do: d = {'a': 1, 'b': 2} 'a' in d True or: d = {'a': 1, 'b': 2} d.has_key('a') True ... One semi-gotcha to avoid though is to make sure you do: "key in some_dict" rather than "key in some_dict.keys()". Both are equivalent semant...
全文閱讀