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))
  assert len(generate_random_string(8)) == 8
output: def generate_random_string(length):
      import string
      import random
      chars = string.ascii_letters + string.digits
      return ''.join(random.choice(chars) for _ in range(length))