How do I generate
[(0,), (1,), (2,), (0,1), (0,2), (1,2), (0,1,2)]
programmatically (that is, without writing everything out by hand)? That is, a list of all nonempty subtuples of the tuple (0,1,2).
(Note this is not asking for subsets but subtuples.)
 
     
     
     
    