Page 1 of 1

Python question Please provide screen shot of the code: -You are asked to write a function that will accept an array of

Posted: Fri Jul 01, 2022 5:42 am
by answerhappygod
Python question
Please provide screen shot of the code:
-You are asked to write a function that will accept an array ofnumbers and an integer representing a target sum.
-If any two numbers from the accepted numbers sum up to thetarget sum, then your function should return them in an array,i nany order
-If no two numbers sum up to the target sum, the function shouldreturn an empty array
- Note that the target sum has to be obtained by summing twodifferent numbers in the array. You cannot add a single integer toitself in order to obtain the target sum
Example Input into your function:
mu_numbers=[3,5,-4,8,11,1,-1,6] | target_sum=10
Example output returned
[-1,11] Numbers can be returned in any order -it does notmatter