input: Write a function to generate a random string of length 8 made of uppercase letters and numbers. The function should return the generated string. If the input length is different from 8, the function should raise an exception.
  assert generate_random_string(8) in [combination for combination in range(62**8)]
  assert generate_random_string(8).isalnum() == True
  assert generate_random_string(8).islower() == False
  assert generate_random_string(8).isupper() == False
  try:
      generate_random_string(10)
  except Exception as e:
      assert str(e) == "The input length must be 8"
  assert generate_random_string(8).isdigit() == False
output: import random
  import string
  
  def generate_random_string(length):
      if length != 8:
          raise Exception("The input length must be 8")
      return ''.join(random.choices(string.ascii_uppercase + string.digits, k=length))