Panhary H.

asked • 02/27/23

Write a function list_difference(numlist1, numlist2) that takes in two lists as parameters

Documentation: 

Use the following template for EVERY function that you write. The docstring below should be placed inside of the function, just after the function signature.

'''

Purpose:

Parameter(s):

Return Value:

'''


Write a function list_difference(numlist1, numlist2) that takes in two lists as parameters. These lists contain numeric values and have the same length. Have the function return a new list that contains the difference between respective items in numlist1 and numlist2, without mutating either of the given lists.


Examples (text in bold is returned):


>>> alist = [5,6,7]

>>> blist = [2,2,2]

>>> list_difference(alist, blist)

[3, 4, 5]





1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.