在python2.x中,dict.keys()返回一个列表,在python3.x中,dict.keys()返回一个dict_keys对象,比起列表,这个对象的行为更像是set,因此不支持索引的。python
解决方案:list(dict.keys())[index]python3.x