def subset_sum(numbers, target, partial=[], partial_sum=0):
if partial_sum == target:
yield partial
if partial_sum >= target:
return
for i, n in enumerate(numbers):
remaining = numbers[i + 1:]
yield from subset_sum(remaining, target, partial + [n], partial_sum + n)
list = [ ]
no=int(input("Enter the count of the List: "))
s=float(input("Enter the target value: "))
for c in range (1,no):
temp=(input("Value "+str(c)+"= " ))
list.extend(map(float, temp.split(", ")))
print(list)
subset_sum(list,s,no)
The objective of the program is to find all the possible combination to reach the specific target. The problem is, it doesn't print the partial after finding the combinations.