python 3.x 版本解决TypeError:‘dict-keys’ object does not support indexing的问题

 python3改变了dict.keys,返回的是dict_keys对象,支持iterable 但不支持indexable,咱们python 能够将其明确的转化成list。spa 在python2中对象 firstStr = myTree.keys()[0]it 在python3中im firstStr = list(myTree.keys())[0]dict
相关文章
相关标签/搜索