Question: This is for python Write a recursive function that finds the smallest number in a list of numbers. Your function should: be named smallest_recursive take

 This is for python Write a recursive function that finds the

This is for python

Write a recursive function that finds the smallest number in a list of numbers. Your function should: be named smallest_recursive take 1 argument, a list of numbers return 1 number, the smallest number in the list HINT: You are allowed to use the min function here, which takes two arguments and retruns the minimum. For example min(3,7) returns 3. You cannot assume that the list is sorted and you should not be sorting it. Graded Read Only import numpy as np np.random.seed(89547) 11 = np.random.randint(-100, 100, 100) a1 = np. sort(11)[0] np. testing.assert_allclose(a1, smallest_recursive(11. tolist())) np.random.seed (485) Read Only 12 = np.random.randint(0, 1000, 100) a2 = np. sort(12)[0] np.testing.assert_allclose(a2, smallest_recursive(12. tolist()))

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 Databases Questions!