Python的dict类型通过get和索引的方式获取值的区别
直接看代码最容易理解了:
```python
test = {'a': 'data'}
test['b']
Traceback (most recent call last):
File " ", line 1, in
KeyError: 'b'
test.get('b')
test.get('b', 'value is none')
'value is
阅读全文...