[1,2,3] I have this list and want to print all subsets of this list using recursion. I am getting the output using the following code but is there any better/easier way? Without typecasting it to a set.
def recur_subset(arr):
if len(arr)==0:
print(arr)
else:
for i in range(0, len(arr)):
print(arr[0:i+1])
for j in range(2, len(arr)):
print([arr[0], arr[j]])
return recur_subset(arr[1:len(arr)])