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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply