m collections import combinations code example
Example 1: how to get all possible combinations in python
all_combinations = [list(zip(each_permutation, list2)) for each_permutation in itertools.permutations(list1, len(list2))]
Example 2: python create a program that runs through all possible combinations
from itertools import combinations
lst = ["a" ,"b", "c"]
lengthOfStrings = 3
for i in combinations(lst, lengthOfStrings):
print(i)