input: 
  import string
  import random
  
  def generate_random_string(length: int) -> str:
      """Generate a random string of specified length using uppercase letters and digits.
      
      >>> generate_random_string(8)
      随机生成的字符串（长度为8）
      """
      chars = string.ascii_uppercase + string.digits
      return ''.join(random.choice(chars) for i in range(length))
  
output:     chars = string.ascii_uppercase + string.digits
      return ''.join(random.choice(chars) for i in range(length))