在python3中使用dict.keys()返回的不在是list类型了,而是dict_keys类型,也不支持索引,我们可以看一下下面这张图片 解决办法就是使用list()函数,即 list(dict.keys())