SyntaxFix
Write A Post
Hire A Developer
Questions
Combination from itertools
import itertools col_names = ["aa","bb", "cc", "dd"] all_combinations = itertools.chain(*[itertools.combinations(col_names,i+1) for i,_ in enumerate(col_names)]) print(list(all_combinations))