I have a list:
list1 = [1,2,3]
and I want to dived it to two list such that:
list2 = [[], [1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]]
list3 = [[1,2,3], [2,3], [1, 3], [1, 2] ,[3], [2], [1], []]
I tried different loops but didn't get all combinations and I thought maybe there is an elegant way instead.