ShriRam Changed status to publish August 18, 2023
from itertools import combinations
my_list = [1,2,3]
subs = []
for i in range(0, len(my_list)+1):
temp = [list(x) for x in combinations(my_list, i)]
if len(temp)>0:
subs.extend(temp)
print(subs)
ShriRam Changed status to publish August 18, 2023