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)  # Different outputs on each call
  assert len(generate_random_string(8)) == 8
  assert any(char.isdigit() for char in generate_random_string(8)) == True  # Contains at least one digit
  assert any(char.isalpha() for char in generate_random_string(8)) == True  # Contains at least one letter
output: import random
  import string
  
  def generate_random_string(length):
      return ''.join(random.choices(string.ascii_letters + string.digits, k=length))