k = {1:10,2:20,3:30,4:40} #idea : print([5,6,7,8][[12,15,47,45].index(15)]) b = list(k.keys())[list(k.values()).index(20)] #find index of 20 => return 2