input: Write a function to delete a given key from a dictionary. The function should return the modified dictionary after the key is removed. If the key is not found in the dictionary, the function should return the dictionary unchanged. The function should handle an empty dictionary as input.
  
  assert delete_key({'foo': 1, 'bar': 2, 'baz': 3}, 'baz')=={'foo': 1, 'bar': 2}
  assert delete_key({'foo': 1, 'bar': 2, 'baz': 3}, 'xyz')=={'foo': 1, 'bar': 2, 'baz': 3}
  assert delete_key({}, 'baz')=={}
  assert delete_key({'foo': 1, 'bar': 2, 'baz': 3}, 'foo')=={'bar': 2, 'baz': 3}
  assert delete_key({'foo': 1, 'bar': 2, 'baz': 3}, 'bar')=={'foo': 1, 'baz': 3}
output: def delete_key(d, key):
      if key in d:
          del d[key]
      return d