Sorry for this basic question but my searches on this are not turning up anything other than how to get a dictionary\'s key based on its value which I would prefer not to us
As simple as that:
mydictionary={'keyname':'somevalue'} result = mydictionary.popitem()[0]
You will modify your dictionary and should make a copy of it first