I have list of tuples with 3 elements. I want to convert it into a dict with preserved order.
>>> a = [('one', '0', '1'), ('two', '0', '0'), ('three', '1', '1')]
>>> x = OrderedDict({sb[0]: sb[1:] for sb in a})
>>> x
OrderedDict([('three', ('1', '1')), ('two', ('0', '0')), ('one', ('0', '1'))])
I see order getting changed, not sure why. Can someone please help me fix this issue?