| 1 | initial version |
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))
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.