×

Welcome to TagMyCode

Please login or create account to add a snippet.
1
0
 
1
Language: Python
Posted by: Jason Kumpf
Added: Jun 4, 2013 2:45 AM
Views: 27
Tags: no tags
Given the set f([10,9,1,10,9,1,1,1,10,9,7]) return all subsets of this given set.
  1. f = lambda x: [[y for j, y in enumerate(set(x)) if (i >> j) & 1] for i in range(2**len(set(x)))]