input: Write a function to encrypt a message using a key in Python. The function should take a message and a key as inputs and produce an encrypted message as the output. If the key is non-empty, it should use the first character of the key to shift each character of the message by its ASCII value. If the key is empty, the function should return the original message unencrypted.
  assert encrypt("Hello world!", "secret") == "ŢĝĬĭĬŉ<｜tool▁calls▁begin｜>Ĭńņŉ"
  assert encrypt("Hello world!", "hello") == "Mjqqt mtwqi!"
  assert encrypt("Hello world!", "") == "Hello world!"
  assert encrypt("", "secret") == ""
  assert encrypt("", "") == ""
output: def encrypt(message, key):
      if not key:
          return message
      shift = ord(key[0])
      encrypted_message = ''.join(chr(ord(char) + shift) for char in message)
      return encrypted_message