```
class Solution(object):
def subsets(self, nums):
"""
:type nums: List[int]
:rtype: List[List[int]]
"""
n=len(nums)
ans=[]
for i in range(0,2**n):
tmp=[]
k=i
for j in range(0,n):
if k%2==1:
tmp.append(nums[j])
k=k/2
#print tmp
ans.append(tmp)
return ans
```