Is it possible to retrieve the items of the default dict, in python, in the same way it was inserted. Below is the snippet of the code.
value = "Examplexa"
od = defaultdict(int)
for i in value:
od[i] = od[i] + 1
print(od)
The above code does the purpose in counting the number of each characters in the string. However, in the output, an unordered dict is displaying. I knew that ordered dict can be used to retrieve the items in the same way it was inserted. but, i am just curious to understand is there a way to arrange output of default dict in a ordered way. Please advise.