Css220

profilep_patel359
allCombinationsUnsorted.py

# Combinations are emitted in lexicographic sort order # of input. So, if the input list is sorted, the # combination tuples will be produced in sorted order. # A Python program to print all combinations # of given length with unsorted input. from itertools import combinations # Get all combinations of [2, 1, 3] # and length 2 comb = combinations([2, 1, 3], 2) # Print the obtained combinations for i in list(comb): print(i)