Advertisement
Guest User

PlatNomorGenerator

a guest
Jan 16th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.12 KB | None | 0 0
  1. import os
  2.  
  3. class Config:
  4.     MOTOR = list(range(3000, 7000))
  5.     MOBIL = list(range(0,3000))
  6.     BIS = list(range(7000,8000))
  7.     PENUMPANG = list(range(8000,9000))
  8.     BEBAN = list(range(9000,10000))
  9.     PLAT_AWAL = ['B','C']
  10.     PLAT_KE_1 = ['U','B','P','S','T','Z','E','N','C','V','K','F','W']
  11.     PLAT_KE_2 = ['A','B','D','W','E','R','U','Z','F','K','O','I','Y','V','P','M','G','J','L','C','T']
  12.     PLAT_KE_2_SPECIAL = ['HX','IX','UA','TX','UX','QN']
  13.     PLAT_KE_3 = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
  14.  
  15. def mobil():
  16.     for i in Config.PLAT_AWAL:
  17.         for j in Config.MOBIL:
  18.             plat_1 = []
  19.             plat_1.append(i+str(j))
  20.             #print(plat_1)
  21.             for a in Config.PLAT_KE_1:
  22.                 for b in Config.PLAT_KE_2:
  23.                     for c in Config.PLAT_KE_3:
  24.                         l = []
  25.                         l.append(a+b+c)
  26.                         e = (plat_1+l)
  27.                         e = [''.join(e)]
  28.                         #e.append(plat_1 + l)
  29.                         print(e)
  30.  
  31. def mobil2():
  32.     for i in Config.PLAT_AWAL:
  33.         for j in Config.MOBIL:
  34.             plat_1 = []
  35.             plat_1.append(i+str(j))
  36.             #print(plat_1)
  37.             for a in Config.PLAT_KE_1:
  38.                 for b in Config.PLAT_KE_2_SPECIAL:
  39.                         l = []
  40.                         l.append(a+b)
  41.                         e = []
  42.                         e.append(plat_1 + l)
  43.                         print(e)
  44.  
  45.  
  46. def motor():
  47.     for i in Config.PLAT_AWAL:
  48.         for j in Config.MOTOR:
  49.             plat_1 = []
  50.             plat_1.append(i+str(j))
  51.             #print(plat_1)
  52.             for a in Config.PLAT_KE_1:
  53.                 for b in Config.PLAT_KE_3:
  54.                     for c in Config.PLAT_KE_3:
  55.                         l = []
  56.                         l.append(a+b+c)
  57.                         e = (plat_1+l)
  58.                         #e.append(plat_1 + l)
  59.                         print(e)
  60.  
  61. def iter():
  62.     for i in mobil():
  63.         yield i
  64.  
  65. start = iter()
  66. for i in start:
  67.     i.next()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement