0
Inverse of method .get? Use of Dictionaries in Phyton
Hi!, Is there a method of dictionaries for enter a value and that it returns the key of that value, the inverse of method .get?
1 Answer
+ 2
There isn't a built in method to do this, but you could create a function to do so. Problem will be that there can be multiple keys that have the same value and the first one found is what would be returned (unless coded otherwise) and the order of which may not be guaranteed.