Question: In Python: Write a function diff(vals1, vals2) that takes as inputs two arbitrary lists of non-negative integers vals1 and vals2 and uses recursion to construct
In Python: Write a function diff(vals1, vals2) that takes as inputs two arbitrary lists of non-negative integers vals1 and vals2 and uses recursion to construct and return a new list in which each element is the the absolute value of the difference of the corresponding elements from the original lists. For example:
>>> diff([3, 4, 2, 5], [7, 2, 9, 5]) result: [4, 2, 7, 0]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
