input: Write a function to generate a random string of specified length made of uppercase letters and numbers. The function should take an integer as input representing the length of the string and return the generated string.
  assert generate_random_string(8) in [''.join(p) for p in itertools.product(string.ascii_uppercase + string.digits, repeat=8)]
  assert len(generate_random_string(8)) == 8
  assert generate_random_string(0) == ""
  assert len(generate_random_string(0)) == 0
  assert generate_random_string(12) in [''.join(p) for p in itertools.product(string.ascii_uppercase + string.digits, repeat=12)]
  assert len(generate_random_string(12)) == 12
output: import random
  import string
  
  def generate_random_string(length):
      return ''.join(random.choices(string.ascii_uppercase + string.digits, k=length))