my_list = ["a","b","c"]
进入字典
my_dict = { 1: "a",2: "b",3: "c" }
键应该只是我的例子中的索引1.
dict(enumerate(my_list,1))
例如:
>>> dict(enumerate(["a","c"],1)) {1: 'a',2: 'b',3: 'c'}