dd = {'a' : True, 'b' : 'bb'} d_cop = dd.copy() bool_keys = ['b'] str_keys = ['a'] for step in d_cop.items(): k = step[0] v = step[1] if k in bool_keys: ...