How can I remove an element from a dictionary based on the index? For example, if I have
d = {'s':0, 'e':1, 't':6}
I want to remove and return the first entry (leftmost), 's' and 0, such that the dictionary has
d = {'e':1, 't':6}
I have tried d.popitem() that removes 't':6. d.pop(key) removes a key from the dictionary, but I have no way of finding the key I want to remove, I only have the index.
list(my_dict)[index]