fork(1) download
  1. from itertools import combinations
  2.  
  3. numbers = [1571.48, 327.53, 286.60, 349.50, 517.67, 247.00, 882.73, 274.00, 237.50, 301.00, 973.50, 288.75, 347.50, 326.81]
  4.  
  5. for i in range(len(numbers)):
  6. for combination in combinations(numbers, i):
  7. if sum(combination) in {4600.31, 2331.26}:
  8. print('A soma de ', combination, 'resultou em', sum(combination))
Success #stdin #stdout 0.02s 28376KB
stdin
Standard input is empty
stdout
Standard output is empty