Jul-12-2020, 06:09 AM
(Jul-12-2020, 05:48 AM)bowlofred Wrote: If you want to generate all passwords of length 5, you could use itertools.product. Repeat for other lengths.
from itertools import product, islice import string # all passwords of lowercase ascii of length 5 pw_iter = map(lambda x: "".join(x), product(string.ascii_lowercase, repeat=5)) # Show first 5 passwords print(list(islice(pw_iter, 5))) # Count the remaining passwords count = len(tuple(pw_iter)) print(f"and {count:,} more passwords.")
Output:['aaaaa', 'aaaab', 'aaaac', 'aaaad', 'aaaae'] and 11,881,371 more passwords.
Thank you men! That is I was searching.