input: Write a python function to generate a random string of a given length using a specified set of characters.
  assert len(random_string(6, 'abcdefghijklmnopqrstuvwxyz')) == 6
  assert len(random_string(10, 'abc123')) == 10
  assert all(c in 'abc123' for c in random_string(5, 'abc123'))
output: import random
  
  def random_string(length, char_set):
      return ''.join(random.choice(char_set) for _ in range(length))