input: Write a function to encrypt a message using a key in Python. The function should take two parameters: message (a string to be encrypted) and key (a string used as the key for encryption). The function should iterate through each character in the message, and for each character, it adds the ASCII value of the first character of the key to the ASCII value of the character in the message, then converts it back to a character and appends it to the encrypted message. The function should return the encrypted message 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") == "Tqxx{!xAb}a"
  assert encrypt("Testing 123", "key") == "Xfurxfq123"
  assert encrypt("", "empty") == ""
  assert encrypt("Python", "code") == "\o{\udq"
  assert encrypt("Encrypt", "key") == "Mlgo{sx"
output: def encrypt(message, key):
      encrypted_msg = ""
      for char in message:
          encrypted_msg += chr(ord(char) + ord(key[0]))
      return encrypted_msg