python - sorting a dictionary of lists based on keys -


संभव डुप्लिकेट:

मैं चाबी के मूल्य के आधार पर सूची का शब्दकोश सॉर्ट करना चाहता हूं ['111', '156', '15 9'], '215': ['109'], '214': ['111', '156', '15 9']: [217 ': [' 109 '], '111'], '21 9': ['111', '114', '212', '214â ????]}

लेकिन मुझे ऐसा कुछ चाहिए ['111', '156', '15 9'], '215': ['111'], '217': ['109'], '21 9': [

< "पोस्ट-टेक्स्ट" आइटमप्रॉप = "टेक्स्ट">

शब्दकोश किसी भी विशेष क्रम में अपनी चाबियाँ नहीं क्रमबद्ध करते हैं, क्योंकि उन्हें हैश तालिका के रूप में लागू किया गया है। आप चीजों और मूल्यों को क्रमबद्ध क्रम में प्राप्त कर सकते हैं, लेकिन एक ऐसा शब्द के रूप में नहीं, जैसे:

  & gt; & gt; & gt; ['111'], '214': ['109'], '214': ['111', '156', '15 9'], '215': ['111'], '21 9': ['111' '114', '212', '214']}> gt; & gt; & gt; ('214', ['111', '156', '15 9']), ('215', ['111']), के लिए [(के, मिडिक्ट [के]), ('217', ['109']), ('21 9', ['111', '114', '212', '214'])]    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

javascript - What is an alternative to using getElementByClass for hiding multiple elements? -

c - Selecting a file randomly from a file system -