I have a Dictionary in Python such as this: dict = {'a':1, 'q':1, 'l':2, 'm':1, 'u':1, 'i':1}
Is there any way that I can keep the order of this dictionary expressed this way. I have read already several forums and most of them suggest using OrderedDict(). But as explained here:
Python OrderedDict not keeping element order
OrderedDict(dict) will not keep the order when the dictionary is written in that form. I can not manually create the dictionary in an specific way (e.g list of tuples) because it is randomly generated by the code elsewhere. Thank you very much for you help!!