Convert python dictionary to python list [on hold]

Multi tool use
Multi tool use
The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Convert python dictionary to python list [on hold]


dictionary = {0:0.2, 9:0.4}

pylist = [0.2, 0, 0, 0, 0, 0, 0, 0, 0, 0.4, 0]



Which is the efficient way to convert dictionary to pylist ? The keys in dictionary form the index in the list, and respective values in the dictionary become the values in list



Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.





What governs the length of the resulting list?
– rahlf23
1 min ago





Why is there a 0 at the end of the list? Before looking for an "efficient" method, do you have the problem properly scoped?
– roganjosh
1 min ago




0





What happened to the 9?
– pault
1 min ago




9





BTW, the 0.4 is in the wrong place in the list if I follow your pattern. I think you want index 0 to be 0.2 and index 9 to be 0.4
– rahlf23
1 min ago




0.4


0


0.2


9


0.4




piSvbGlARMaOGBSwhP 2,qWAAQ,gG,4Q2M,jo1irbfOts2iP,Ba oBb9Kx5lSGSQtygHKXCns1cvnZV,AOE1mSU2P64Fz,pvPc
jSAyrZSvD8 DBg

Popular posts from this blog

Keycloak server returning user_not_found error when user is already imported with LDAP

PHP parse/syntax errors; and how to solve them?

415 Unsupported Media Type while sending json file over REST Template