input: Write a function to encrypt a message using a key in Python. Return the encrypted message as a string. If the message or key is empty, return an empty string.
  assert encrypt("Hello world!", "secret")==')789:;<=>?@'
  assert encrypt("Python", "key")=='Tw}qr{'
  assert encrypt("", "abc")==''
  assert encrypt("Testing", "")==''
  assert encrypt("", "")==''
output: def encrypt(message, key):
      if not message or not key:
          return ""
      encrypted = []
      for i, char in enumerate(message):
          key_char = key[i % len(key)]
          encrypted_char = chr(ord(char) + ord(key_char))
          encrypted.append(encrypted_char)
      return ''.join(encrypted)