Dictionaries in python are not "orderly". There are several other python-classable objects, so I suggest you use one of them, and then transfer it to an OrderedDict dictionary (which, unlike an ordinary dictionary, keeps the order it was created each time you access it) p>
from collections import OrderedDict
# Criando pontuações em lista de tuplas (poderia ser lista de listas)
data = [('Asma', 6), ('Cachumba', 5), ('Difteria', 4),('Rubeola', 9)]
# Criando o dicionario
od = OrderedDict([par for index, par in sorted((tpl[1], tpl) for tpl in data)])
print (od)
OrderedDict([('Difteria', 4), ('Cachumba', 5), ('Asma', 6), ('Rubeola', 9)])
print(od['Cachumba'])
5
Edited
If you want reverse order:
# Criando pontuações em lista de tuplas (poderia ser lista de listas)
data = [('Asma', 6), ('Cachumba', 5), ('Difteria', 4),('Rubeola', 9)]
# Criando a indexação na ordem reversa
dr = sorted([(tpl[1], tpl) for tpl in data], reverse=True)
# Criando o dicionário
od = OrderedDict([tpl[1] for tpl in dr])
print (od)
OrderedDict([('Rubeola', 9), ('Asma', 6), ('Cachumba', 5), ('Difteria', 4)])
Note:
If your list is already sorted, then just create the dictionary (OrderedDict) normally. As for the "command" question at the end of the question, I could not understand, the purpose of the dictionaries is to only map keys / values.