def subdict(d, keys):
 result = {}
 for key in keys:
  if (key in d):
   result[key] = d[key]
 return result

def subdict ( d , keys ) : result = { } for key in keys : if ( key in d ) : result [ key ] = d [ key ] return result
create a subdictionary of d with the keys in keys parameters d : writeme keys : writeme returns writeme .