Skip to content

Instantly share code, notes, and snippets.

@mkpoli
Created September 22, 2021 09:47
Show Gist options
  • Select an option

  • Save mkpoli/d2df5add0b382a913adf559d90f7d67d to your computer and use it in GitHub Desktop.

Select an option

Save mkpoli/d2df5add0b382a913adf559d90f7d67d to your computer and use it in GitHub Desktop.
Generator all combination from 00 to zz (include duplication)
import string
import itertools
characters = [*map(str, range(10)), *list(string.ascii_lowercase)]
print(characters)
all_combi = list(
map(
lambda x: f'{x[0]}{x[1]}',
itertools.product(characters, repeat=2)
)
)
print(all_combi)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment