I have a list that looks like this:
l1 = [\'200:200\', \'90:728\']
I have a dictionary that looks like this:
d1 = {\'200:20
You can use a list comprehension in the dict constructor:
result = dict([(k,d1[k]) for k in l1 if k in d1])
If you're worried about removing duplicate keys, make l1 into a set first:
result = dict([(k,d1[k]) for k in set(l1) if k in d1])