input: Write a python function to safely execute a given Python code and handle any exceptions, returning the error message if an exception occurs.
  assert safe_exec("print(1 + 1)") == None
  assert safe_exec("1 / 0") == "Error: division by zero"
  assert safe_exec("x = [1, 2, 3][5]") == "Error: list index out of range"
output: def safe_exec(code):
      try:
          exec(code)
          return None
      except Exception as e:
          return f"Error: {str(e)}"