Question: Why I keep getting this error? Please also help me test if my code works correctly after you fix the error. Results From Running Your

Why I keep getting this error? Please also help me test if my code works correctly after you fix the error.

Why I keep getting this error? Please also help me test ifmy code works correctly after you fix the error. Results From Running

Results From Running Your Instructor's Tests (50.0%) Summary: 6 cases (0 failures, 3 errors) EEE . . . ERROR: test1 (_main_. IsDiffTwoTest) TypeError: 'type' object is not subscriptable ERROR: test2 (_main_. IsDiffTwoTest) TypeError: 'type' object is not subscriptable ERROR: test3 (_main_. IsDiffTwoTest) TypeError: 'type' object is not subscriptable Ran 6 tests in 0. 002s FAILED (errors=3)Problem 2 [50 points] Design a recursive algorithm that will display whether it is possible to choose two integers from a list of integers such that the difference between the two equals a given value. Hint: You may wish to invoke another algorithm, (i.e., function), that accepts more parameters that perform the recursion. Submit a python function is_diff_two(values, diff) that take a list and the desired difference as a non-negative integer and returns true or false. Examples: is_diff_two ( [2, 4, 8], 4) # returns True is_diff_two( [1, 2, 4, 8, 1], 7) # returns True is_diff_two( [2, 4, 4, 8], 7) # returns False is_diff_two( , 7) # returns False is_diff_two ( [-1, -3,5, 8, 10], 11) #returns True

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!