input: Write a function to encrypt a message using a given key in Python. The function should take a message and a key as inputs and return the encrypted message. The encryption should be done by adding the ASCII value of each character in the message to the ASCII value of the first character of the key. The encrypted message should be returned as a string.
  
  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")=="Tfqq}zpz'{\\|"
  assert encrypt("OpenAI", "key")=="T{qsKG"
  assert encrypt("Python", "lock")=="[xckqy"
  assert encrypt("", "key")==""
  assert encrypt("Encrypt", "secret")=="K{rv`rx"
output: def encrypt(message, key):
      encrypted_msg = ""
      for char in message:
          encrypted_msg += chr(ord(char) + ord(key[0]))
      return encrypted_msg