input: Write a python function to generate a random string of given length using letters and digits.
  assert len(generate_random_string(8)) == 8
  assert len(generate_random_string(12)) == 12
  assert isinstance(generate_random_string(5), str)
output: import random
  import string
  
  def generate_random_string(length):
      characters = string.ascii_letters + string.digits
      return ''.join(random.choice(characters) for _ in range(length))