Python dictionary keys are unordered except that they exist in the order in which they were added.
The most Pythonic way to handle your problem would be to sub-class UserDict.
Something like this:
from collections import UserDict
class Dict(UserDict):
def __getitem__(self, i):
key = list(super().keys())[i]
return super().__getitem__(key)
myDict = {
"Fast" : "In a Quick Manner",
"Abhishek" : "A student",
233 : "Abhishek",
"a" : ["Abhi","Aka"],
"b" : [ "abhi",1],
"hey" : [1,2],
"hii" : (22, 44, 555),
"nesteddictionary" : {"RAM":1,"SITA":2,"HANUMAN":3}}
d = Dict(myDict)
print(d[2])
Output:
Abhishek
Note:
Of course this means that you would not be able to access values by key in the normal way using this class. What you would need to do is reference the UserDict's data attribute. For example:
print(d.data['b'])
Output:
['abhi', 1]