input: Write a function to generate a random string of length 8 made of uppercase letters and numbers. If the input length is different from 8 then return None.
  
  assert generate_random_string()=="ABC123EF"
  assert generate_random_string()!="abcdefgh"
  assert generate_random_string()!=None
  assert generate_random_string(9)==None
  assert generate_random_string(7)==None
output: import random
  import string
  
  def generate_random_string(length=8):
      if length != 8:
          return None
      return ''.join(random.choices(string.ascii_uppercase + string.digits, k=length))