input: from typing import List
  
  
  def encrypt(message: str, key: str) -> str:
      """Encrypt a message using a key by adding the ASCII value of the key's first character
      to each character of the message. Return the encrypted message as a string.
      >>> encrypt("Hello world!", "secret")
      'Tqxxa cqymne!'
      """
      encrypted_msg = ""
      for char in message:
          encrypted_msg += chr(ord(char) + ord(key[0]))
      return encrypted_msg
output:     encrypted_msg = ""
      for char in message:
          if char.isalpha():
              new_char = chr((ord(char.lower()) - ord('a') + ord(key[0])) % 26 + ord('a'))
              if char.isupper():
                  new_char = new_char.upper()
              encrypted_msg += new_char
          else:
              encrypted_msg += char
      return encrypted_msg