myDict ={"key1" : "val1","key2" : "val2","key3" : "val3","key4" : "x","key5" : "x"}
I need a def in python that take (myDict and "x") and then return a newDict like this:
newDict ={"key4":"x","key5":"x"}
myDict ={"key1" : "val1","key2" : "val2","key3" : "val3","key4" : "x","key5" : "x"}
I need a def in python that take (myDict and "x") and then return a newDict like this:
newDict ={"key4":"x","key5":"x"}
def find(dictionary, key):return dict(zip((p:=list(filter(lambda x: dictionary[x] == key, dictionary))), key * len(p)))