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. The function should take two parameters: the dictionary and the key to be deleted.
  assert delete_key({'foo': 1, 'bar': 2, 'baz': 3}, 'baz')=={'foo': 1, 'bar': 2}
  assert delete_key({'a': 10, 'b': 20, 'c': 30}, 'd')=={'a': 10, 'b': 20, 'c': 30}
  assert delete_key({}, 'any_key')=={}
  assert delete_key({'key1': 'value1'}, 'key1')=={}
  assert delete_key({'key1': 'value1', 'key2': 'value2'}, 'key2')=={'key1': 'value1'}
output: def delete_key(d, key):
      if key in d:
          del d[key]
      return d