Advertisement
Guest User

Untitled

a guest
May 26th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. import itertools
  2. import string
  3. from time import sleep
  4.  
  5.  
  6. def combinations():
  7. for i in range(1, 4):
  8. yield from itertools.product(string.ascii_lowercase, repeat=i)
  9.  
  10.  
  11. def step(g):
  12. tasks_list = []
  13. for i in range(1000):
  14. try:
  15. query = ''.join(next(g))
  16. tasks_list.append(query)
  17. except StopIteration:
  18. return None, None
  19. return check, tasks_list
  20.  
  21.  
  22. g = combinations()
  23. check = True
  24.  
  25. while check:
  26. check, list_tasks = step(g)
  27. print(list_tasks)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement