Question: Write a function, triple_sum(num_lst, target), that takes in a list of distinct integers, num_lst, and an integer, target. triple_sum should print all sets of three
Write a function, triple_sum(num_lst, target), that takes in a list of distinct integers, num_lst, and an integer, target. triple_sum should print all sets of three distinct integers in num_lst that sum to target. Be sure that you only print each combination once: 0+7+2 is not a distinct combination from 7+0+2. triple_sum should then return the total number of distinct combinations found that sum to the target.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
