In python... I have a list of elements \'my_list\', and a dictionary \'my_dict\' where some keys match in \'my_list\'.
I would like to search the dictionary and retrieve
Don't use dict and list as variable names. They shadow the built-in functions. Assuming list l and dictionary d:
dict
list
l
d
kv = [(k, d[k]) for k in l if k in d]