Css220
# This method takes a list and a input r as # an input and return a object list of tuples # which contain all possible combination of # length r in a list form. # A Python program to print all # combinations of given length from itertools import combinations # Get all combinations of [1, 2, 3] # and length 2 comb = combinations([1, 2, 3], 2) # Print the obtained combinations for i in list(comb): print(i)