input: 
  import random 
  
  def generate_password(chars: str, length: int) -> str:
      """ Generate a random password using the provided characters and given length.
      >>> generate_password("abcdefghijklmnopqrstuvwxyz01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()?", 8)
      'aB3$jK8z'
      >>> generate_password("ABCD1234", 6)
      'A3B4C2'
      """
      password = "".join(random.sample(chars, length))
      return password
  
output:     password = "".join(random.choices(chars, k=length))
      return password