input: Write a function to delete a given key from a dictionary. If the key is present in the dictionary, it should be removed. If the key is not present, the dictionary should remain unchanged. The function should return the modified dictionary.
  
  def delete_key(dic, k):
    if k in dic:
      del dic[k]
    return dic
  
  dictionary = {'foo': 1, 'bar': 2, 'baz': 3}
  key = 'baz'
  assert delete_key(dictionary.copy(), key)=={'foo': 1, 'bar': 2}
  
  dictionary = {'foo': 1, 'bar': 2, 'baz': 3}
  key = 'qux'
  assert delete_key(dictionary.copy(), key)=={'foo': 1, 'bar': 2, 'baz': 3}
  
  dictionary = {}
  key = 'baz'
  assert delete_key(dictionary.copy(), key)=={}
output: def delete_key(dic, k):
    if k in dic:
      del dic[k]
    return dic