input: Write a function to encrypt a message using a key in Python.
  
  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{,esp'u-"
  assert encrypt("Python", "key")=="[tyvn@"
  assert encrypt("Cryptography", "secure")=="T{svkx}uwitp"
  assert encrypt("Encryption", "code")=="Gnhrwvgqkt"
  assert encrypt("", "key")==""
output: def encrypt(message, key):
      encrypted_msg = ""
      for char in message:
          encrypted_msg += chr(ord(char) + ord(key[0]))
      return encrypted_msg