【发布时间】:2020-10-25 01:49:50
【问题描述】:
我有以下字典:
{
'0':'test1'
'1':'test2'
'2':'test3'
'3':'test4'
}
我想将它转换成一个数组,如您所见,其中的键是索引,key values是values。
所以,基本上,我想要['test1', 'test2', 'test3', 'test4']。
有another question like this,我读过,但它没有解决我的问题,因为我想要字典的键 作为指数。
【问题讨论】:
-
如果键是例如 1-2-5-7 怎么办?结果数组应该有多大?
标签: python