Answers for "get key from value dictionary py"

0

get key from value dictionary py

dict = {1: 'a', 2: 'b'}
value = 'a'
key = [x for x in dict.keys() if dict[x] == value][0]
Posted by: Guest on January-15-2022

Code answers related to "get key from value dictionary py"

Python Answers by Framework

Browse Popular Code Answers by Language