input: Write a function to encrypt a message using a given key in Python. If the message or the key is empty, return an empty string. Otherwise, for each character in the message, add the ASCII value of the first character of the key to it and append the result to the encrypted message. Finally, return the encrypted message.
  
  assert encrypt("Hello world!", "secret")=="Tqxx{,xfsl&"
  assert encrypt("Hi there!", "key")=="Mn pz%ljy&"
  assert encrypt("OpenAI", "lock")=="X{wszO"
  assert encrypt("Python", "")==""
  assert encrypt("", "key")==""
output: def encrypt(message, key):
      if not message or not key:
          return ""
      encrypted_message = ""
      key_char = key[0]
      for char in message:
          encrypted_message += chr(ord(char) + ord(key_char))
      return encrypted_message