# Write a Python program to Keys associated with Values in Dictionary # Python3 code to demonstrate working of # Values Associated Keys# Using defaultdict() + loopfrom collections import defaultdict  # initializing dictionarytest_dict = {'gfg' : [1, 2, 3], 'is' : [1, 4], 'best' : [4, 2]}   # printing original dictionaryprint("The original dictionary is : " + str(test_dict))  # Values Associated Keys# Using defaultdict() + loopres = defaultdict(list)for key, val in test_dict.items():    for ele in val:        res[ele].append(key)  # printing result print("The values associated dictionary : " + str(dict(res))) 