input: Write a function to generate a random string of length 8 made of uppercase letters and numbers. If the length is not provided, the default length should be 8. If the string length is different, then it must adjust accordingly. The function must handle the case where the length is negative or zero, in which case it should return an empty string.
  assert generate_random_string()==chr(65) or generate_random_string()==chr(66) or generate_random_string()==chr(67) #allowed characters are A,B,C
  assert generate_random_string(length=0) ==""
  assert len(generate_random_string())==8
  assert all(c in string.ascii_uppercase + string.digits for c in generate_random_string())
output: import random
  import string
  
  def generate_random_string(length=8):
      if length <= 0:
          return ""
      return ''.join(random.choices(string.ascii_uppercase + string.digits, k=length))