input: 
  import string
  import random
  
  def generate_random_string(length: int = 8) -> str:
      """ Generate a random string of given length made of uppercase letters and numbers.
      >>> password1 = generate_random_string()
      >>> len(password1) == 8
      True
      >>> all(c in string.ascii_uppercase + string.digits for c in password1)
      True
      >>> password2 = generate_random_string(12)
      >>> len(password2) == 12
      True
      """
      chars = string.ascii_uppercase + string.digits
      return ''.join(random.choice(chars) for _ in range(length))
  
output:     chars = string.ascii_uppercase + string.digits
      return ''.join(random.choice(chars) for _ in range(length))