Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. from string import ascii_lowercase
  2. import itertools
  3.  
  4. def iter_all_strings():
  5.     for size in itertools.count(1):
  6.         for s in itertools.product(ascii_lowercase, repeat=size):
  7.             yield "".join(s)
  8.  
  9. for s in iter_all_strings():
  10.     print(s)
  11.     if s == 'bb':
  12.         break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement