from itertools import combinations lst = ["a" ,"b", "c"] lengthOfStrings = 3 for i in combinations(lst, lengthOfStrings): print(i)