input: Write a python function to generate a random password with given length and characters.
  assert len(generate_password(10, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!^()#@')) == 10
  assert len(generate_password(12, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!^()#@')) == 12
  assert len(generate_password(8, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!^()#@')) == 8
output: import random
  
  def generate_password(length, characters):
      return ''.join(random.choice(characters) for _ in range(length))