Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

how to create total possible sub sets of a list python

# Python Program to Print
# all subsets of given size of a set
 
import itertools
 
def findsubsets(s, n):
    return list(itertools.combinations(s, n))
 
# Driver Code
s = {1, 2, 3}
n = 2
 
print(findsubsets(s, n))
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #create #total #sets #list #python
ADD COMMENT
Topic
Name
7+9 =