input: Write a function to encrypt a message using a key in Python. The function should take in two parameters: the message to be encrypted and the key used for encryption. The function should return the encrypted message. In the encryption process, each character in the message should be shifted by the ASCII value of the first character of the key.
  assert encrypt("Hello world!", "secret")=="Ifmmp!xpsme\"
output: def encrypt(message, key):
      shift = ord(key[0])
      encrypted_message = ""
      for char in message:
          encrypted_message += chr(ord(char) + shift)
      return encrypted_message