在python中经常遇到keyerror的问题
1.a={},a[2]+=3,会遇到keyerror的问题。但是如果a.setdefault(2, 0).问题就解决了。
posted on 2014-11-11 15:13 hope1900 阅读(1189) 评论(0) 收藏 举报