input: Write a function to encrypt a message using a key in Python. The function should take a message and a key as input and return an encrypted message by shifting each character in the message by the ASCII value of the first character of the key. If the message or key is empty, the function should return the original message.
  assert encrypt("Hello world!", "secret")=="Tqxx{ y|w|!"
  assert encrypt("OpenAI", "key")=="Tt{El"
  assert encrypt("Python", "code")=="Z{emos"
  assert encrypt("", "secret")==""
  assert encrypt("Hello", "")=="Hello"
output: def encrypt(message, key):
      if not message or not key:
          return message
      shift = ord(key[0])
      encrypted_message = ''.join(chr((ord(char) + shift - 32) % 95 + 32) if char.isprintable() else char for char in message)
      return encrypted_message