input: Write a function to encrypt a string using a given key with base64 encoding.
  assert encrypt("key", "hello") == "aGVsbG8="
  assert encrypt("secret", "world") == "d29ybGQ="
  assert encrypt("python", "programming") == "cHJvZ3JhbW1pbmc="
output: def encrypt(key, string):
      import base64
      encoded_bytes = base64.b64encode(string.encode('utf-8'))
      return encoded_bytes.decode('utf-8')