input: Write a function to generate a random string of a specified length, containing alphanumeric characters. The function should take an integer as an input parameter representing the length of the string. If the specified length is less than or equal to zero, the function should return an empty string.
  assert generate_random_string(8) != generate_random_string(8)
  assert len(generate_random_string(5)) == 5
  assert generate_random_string(0) == ""
  assert generate_random_string(-3) == ""
  assert all(c in string.ascii_letters + string.digits for c in generate_random_string(10))
output: import random
  import string
  
  def generate_random_string(length):
      if length <= 0:
          return ""
      return ''.join(random.choices(string.ascii_letters + string.digits, k=length))