input: Write a function to delete a given key from a dictionary. If the key exists in the dictionary, it should be removed; otherwise, the dictionary should remain unchanged.
  assert delete_key({'foo': 1, 'bar': 2, 'baz': 3}, 'baz')=={'foo': 1, 'bar': 2}
  assert delete_key({'foo': 1, 'bar': 2}, 'qux')=={'foo': 1, 'bar': 2}
  assert delete_key({}, 'anything')=={}
output: def delete_key(d, key):
      if key in d:
          del d[key]
      return d