a=['a','b','c','d','e','f'] b = {'a':10000,'d':15000} c = {n:5000 if list(b).count(n)==0 else b[n] for n in a}