S
S
Semyon Vinyaminych2018-05-03 13:34:48
Python
Semyon Vinyaminych, 2018-05-03 13:34:48

How to sort a dictionary inside which there is another dictionary?

Python 3.5 +
Has a dictionary:

{
  "Россия" : 
  {
    "Москва" : 
    {
      "Население" : 5129
      "Благоустройство" : 10
    }
    "СПб" : 
    {
      "Население" : 5486
      "Благоустройство" : 8
    }
    "Уссурийск" : 
    {
      "Население" : 4685
      "Благоустройство" : 7
    }
    "село Запарашье" : 
    {
      "Население" : 35
      "Благоустройство" : 2
    }
  }
  // и другие страны
}

You need to sort the elements inside by population.
I rummaged through many articles, but stubbornly I can not beat it

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DDDsa, 2018-05-03
@DDDsa

Dictionary cannot be sorted

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question