I have the below strings in a list and have been able to create a dictionary using the list as key in the dictionary and assigning default of ''. When I print, I see the dictionary is created in reverse order for string in list. Why does this happen and how to correct it. Is there a reverse syntax required ?
a = ['hello','bye','tc','iam']
created_dict = dict((bl,'') for bl in a)
print created_dict # {'iam': '', 'bye': '', 'hello': '', 'tc': ''}
What needs to be changed to get the below result.
expected result : {'hello': '', 'bye': '', 'tc': '', 'iam': ''}
It maintains the order when numbers are used in list