python Ordered dict to dict 1

python Ordered dict to dict

>>> from collections import OrderedDict
>>> dict(OrderedDict([('method', 'constant'), ('data', '1.225')]))
{'data': '1.225', 'method': 'constant'}

Here is what the above code is Doing:
1. Create an OrderedDict from the list of tuples.
2. Convert the OrderedDict to a regular dict.

Similar Posts