input: Write a function to encrypt a message using a key in Python. The function should take two parameters: the message to be encrypted and the key to use for encryption. The output should be the encrypted message. The encryption process involves adding the ASCII value of the first character of the key to the ASCII value of each character in the message, and then converting the result back to a character. If the key is too short, it should repeat the key until it is long enough to encrypt the entire message.
  assert encrypt("Hello world!", "secret")==">igopt"xqupiA"
  assert encrypt("Python", "key")=="T{uzqp"
  assert encrypt("Encrypt", "123")=="Gpctqv|"
  assert encrypt("", "secret")=="None"
  assert encrypt("Test", "a")=="Uftu"
  assert encrypt("Message", "longkey")=="?jqyjph"
output: def encrypt(message, key):
      encrypted_message = ""
      key_length = len(key)
      for i, char in enumerate(message):
          key_char = key[i % key_length]
          encrypted_char = chr(ord(char) + ord(key_char))
          encrypted_message += encrypted_char
      return encrypted_message