Possible Duplicate:
Python code to pick out all possible combinations from a list?
I have a list say [1, 2, 3]. I want to find the all the combinations
C(3,1)
[1] [2] [3]
C(3,2)
[1,2] [2,3] [1,3]
C(3,3)
[1,2,3]
Is there some module/library for doing this?