input: Write a function to generate a random string of length `length` made of uppercase letters and numbers. The function should return the generated string.
  assert generate_random_string(8) is not None
  assert len(generate_random_string(8)) == 8
  assert any(c in string.ascii_uppercase + string.digits for c in generate_random_string(8))
  assert generate_random_string(0) is ''
  assert generate_random_string(10) is not None
  assert len(generate_random_string(10)) == 10
  assert any(c in string.ascii_uppercase + 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_uppercase + string.digits, k=length))