input: Write a function to delete a given key from a dictionary in Python. If the key exists in the dictionary, it should be removed; otherwise, the dictionary remains unchanged. The function should take two arguments: the dictionary and the key to be deleted. If the key is not found, the function should not raise an error.
  
  assert delete_key({'foo': 1, 'bar': 2, 'baz': 3}, 'baz') == {'foo': 1, 'bar': 2}
  assert delete_key({}, 'baz') == {}
  assert delete_key({'foo': 1, 'bar': 2, 'baz': 3}, 'qux') == {'foo': 1, 'bar': 2, 'baz': 3}
  assert delete_key({'a': 1, 'b': 2, 'c': 3}, 'b') == {'a': 1, 'c': 3}
  assert delete_key({'foo': 1}, 'foo') == {}
output: def delete_key(d, key):
      if key in d:
          del d[key]
      return d