我有以下字典{44: [0, 1, 0, 3, 6]},需要将其转换为,dict1 = {44: {0:0, 1:1, 2:0, 3:3, 4:6}}但是我当前的for循环不起作用:
maxnumbers = 5 #this is how many values are within the list
for i in list(range(maxnumbers)):
for k in list(dict1.keys()):
for g in dict1[k]:
newdict[i] = g
print(num4)
Run Code Online (Sandbox Code Playgroud)
你能帮助我吗?提前致谢。