input: Write a function to generate a random string of length 8 containing alphanumeric characters.
  
  def generate_random_string(length):
   chars = string.ascii_letters + string.digits
   return ''.join(random.choice(chars) for _ in range(length))
  
  import string
  import random
  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))
output: import string
  import random
  
  def generate_random_string(length):
      chars = string.ascii_letters + string.digits
      return ''.join(random.choice(chars) for _ in range(length))