input: Write a function to generate a random string of a given length containing alphanumeric characters. The function should take an integer length as input and return a string of that length.
  assert generate_random_string(8)=='a1B2c3D4'
  assert generate_random_string(4)=='Z9y8'
  assert generate_random_string(5)=='R6fG2'
  assert generate_random_string(6)=='7JkLm9'
  assert generate_random_string(3)=='X4y'
output: import random
  import string
  
  def generate_random_string(length):
      return ''.join(random.choices(string.ascii_letters + string.digits, k=length))