input: from typing import List
  
  def generate_random_string(length: int) -> str:
      """ Generate a random string of specified length made of uppercase letters and numbers.
      >>> generate_random_string(8)
      'A3B7D2F1'
      >>> generate_random_string(4)
      'Z9X2'
      """
      import string
      import random
      
      chars = string.ascii_uppercase + string.digits
      return ''.join(random.choice(chars) for _ in range(length))
output:     import string
      import random
      
      chars = string.ascii_uppercase + string.digits
      return ''.join(random.choice(chars) for _ in range(length))