input: Write a function to generate a random string of length 8 containing alphanumeric characters. If no length is provided, the default length should be 8.
  def generate_random_string(length=8):
   chars = string.ascii_letters + string.digits
   return ''.join(random.choice(chars) for _ in range(length))
  assert len(generate_random_string())==8
  assert all(c in string.ascii_letters + string.digits for c in generate_random_string())==True
  assert len(generate_random_string(5))==5
  assert all(c in string.ascii_letters + string.digits for c in generate_random_string(5))==True
output: def generate_random_string(length=8):
      chars = string.ascii_letters + string.digits
      return ''.join(random.choice(chars) for _ in range(length))