input: Write a function to encrypt a message using a key in Python. The function should take two parameters: a string `message` and a string `key`. It should return a string that represents the encrypted message. The encryption process should be such that each character in the message is shifted by the ASCII value of the first character of the key.
  
  def encrypt(message, key):
      encrypted_msg = ""
      for char in message:
          encrypted_msg += chr(ord(char) + ord(key[0]))
      return encrypted_msg
  
  assert encrypt("Hello world!", "secret")=="Tqxx{ yxvc|}"
  assert encrypt("Python programming", "abcd")=="Qzuipo!qsphsbnjhob"
  assert encrypt("Encrypt this message", "xyz")=="Hm|nu|xy!nkvh!qhfovh"
  assert encrypt("", "key")==""
  assert encrypt("Test", "")=="Test"
output: def encrypt(message, key):
      if not key:
          return message
      encrypted_msg = ""
      for char in message:
          encrypted_msg += chr(ord(char) + ord(key[0]))
      return encrypted_msg