‘dict’ object has no attribute 'has_key'解决办法

Python2有has_key()方法,Python3以后删除了has_key()方法!
Python3方法更改为:

if key1 in adict:  
点赞