2 Matching Annotations
  1. Oct 2025
    1. import string

      def generate_license_plates(num_to_print=10):

      letters = string.ascii_uppercase  # A-Z (26 characters)
      numbers = string.digits          # 0-9 (10 characters)
      
      total_plates = len(letters)**3 * len(numbers)**4
      print(f"--- License Plate Generation (Nested Loops) ---")
      print(f"Total possible unique license plates: {total_plates:,}")
      print(f"Displaying the first {num_to_print} sample license plates:")
      print("-" * 40)
      
      count = 0
      
      
      for L1 in letters:
      
          for L2 in letters:
      
              for L3 in letters:
      
      
                  for N1 in numbers:
      
                      for N2 in numbers:
      
                          for N3 in numbers:
      
                              for N4 in numbers:
      
      
                                  license_plate = f"{L1}{L2}{L3}{N1}{N2}{N3}{N4}"
                                  print(license_plate)
      
                                  count += 1
      
      
                                  if count >= num_to_print:
      
                                      return
      
      print("-" * 40)
      print("Generation complete for the sample set.")
      

      generate_license_plates(num_to_print=10)

  2. Sep 2025