First time here? Check out the FAQ!
answered 2 years ago
One may use enumerate and string formating:
for (i,t) in enumerate(test_comb, start=1): if (sum(t)==H): #Checking which combinations in test_sum give the sum = H and printing those print("({}) A combination is: {}\n".format(i, t))