Suggest a feature

Welcome to TagMyCode

Please login or create account to add a snippet.
Language: Python
Posted by: Jason Kumpf
Added: Jun 4, 2013 2:45 AM
Views: 63
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)))]