get all subsets of a list python

Solutions on MaxInterview for get all subsets of a list python by the best coders in the world

showing results for - "get all subsets of a list python"
Helena
05 Jan 2020
1a_set = {"a", "b", 1, 2}
2data = itertools.combinations(a_set, 2)
3subsets = set(data)
4print (subsets)