Answers for "how to create total possible sub sets of a list python"

0

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))
Posted by: Guest on March-13-2022

Code answers related to "how to create total possible sub sets of a list python"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language