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")=="Pmttw]uxrf!"
  assert encrypt("Python Programming", "key")=="T{Cxuh|&Spvtkng"
  assert encrypt("Data Science", "pass")=="Ibhd]Xlmfnqh"
  assert encrypt("Machine Learning", "code")=="Owgy{x!Sohkkwjx"
  assert encrypt("", "empty")=="
  
  
output: def encrypt(message, key):
      encrypted_msg = ""
      for char in message:
          encrypted_msg += chr(ord(char) + ord(key[0]))
      return encrypted_msg