input: Write a function to generate a random string of a specified length containing alphanumeric characters.
  
  assert generate_random_string(8) != generate_random_string(8)
  assert len(generate_random_string(8)) == 8
  assert any(c.isdigit() for c in generate_random_string(8))
  assert any(c.isalpha() for c in generate_random_string(8))
  assert len(generate_random_string(0)) == 0
  assert len(generate_random_string(12)) == 12
output: import random
  import string
  
  def generate_random_string(length):
      return ''.join(random.choices(string.ascii_letters + string.digits, k=length))