input: Write a python function to encrypt a string using a given key with a character shift based on the ordinal values of the characters in the string and key.
  assert encrypt("hello", "abc") == "igomq"
  assert encrypt("encrypt", "key") == "ktcuxz|"
  assert encrypt("secrets", "password") == "\x8a\x9c\x9a\x89\x9e\x9b\x8b"
output: def encrypt(string, key):
      encrypted = []
      key_length = len(key)
      
      for i, char in enumerate(string):
          shift = ord(key[i % key_length])
          encrypted_char = chr(ord(char) + shift)
          encrypted.append(encrypted_char)
          
      return ''.join(encrypted)