input: Write a function to generate a random string of length n made of uppercase letters and numbers.
  
  assert generate_random(8) != generate_random(8)
  assert len(generate_random(8)) == 8
  assert generate_random(0) == ""
  assert all(c in string.ascii_uppercase + string.digits for c in generate_random(10))
output: import random
  import string
  
  def generate_random(n):
      if n == 0:
          return ""
      return ''.join(random.choices(string.ascii_uppercase + string.digits, k=n))