If a key is present in a dictionary, I want to know what position the key is in i.e the numerical index. For example :
if the dictionary consists of :
{'test':{1,3},'test2':{2},'test3':{2,3}}
if 'test' in dictionary:
print(the index of that key)
The output would be 0 for example. (The output would be 2 for 'test3'...)
I'm using a dictionary at the moment, I'm guessing I'd have to use an ordered dict to do this, but how can I do it using an ordered dict ?
Thanks for any help.