input: Write a function to encrypt a message using a key in Python. The function should take two inputs: the message and the key. It should return the encrypted message by adding the ASCII value of each character in the message to the ASCII value of the first character in the key. If the message or key is empty, the function should return an empty string as the encrypted message.
  
  def encrypt(message, key):
      if not message or not key:
          return ""
      encrypted_msg = ""
      for char in message:
          encrypted_msg += chr(ord(char) + ord(key[0]))
      return encrypted_msg
  
  assert encrypt("Hello world!", "secret")=="Ifmmp!xpsme\"
  assert encrypt("Python", "key")=="Qzuipo"
  assert encrypt("", "key")==""
  assert encrypt("message", "")==""
  assert encrypt("!@#$%^", "a")=="b@cdef"
output: def encrypt(message, key):
      if not message or not key:
          return ""
      encrypted_msg = ""
      for char in message:
          encrypted_msg += chr(ord(char) + ord(key[0]))
      return encrypted_msg