这两个都是一样的结果呢
1 2 3 |
|
PHP中文网2017-04-17 11:10:18
Official documentation recommends using key in dict syntax because it is shorter and easier to understand. has_key is an old legacy API, left behind to support code before 2.2. This function has been removed in Python3.
PHPz2017-04-17 11:10:18
The information above is detailed enough, so I’ll just post some code:
1 2 3 4 5 6 7 8 9 10 |
|
高洛峰2017-04-17 11:10:18
is the same, in
has a more pythonic feel, has_key
has been removed in python3: http://docs.python.org/3.1/whatsnew/3...