Question: In this question, the function below first_negative takes a list of numbers (creatively-named numbers ). Your goal is to write a while loop that searches

In this question, the function below first_negative takes a list of numbers (creatively-named numbers ). Your goal is to write a while loop that searches for the first negative number in the list. You should set the variable num equal to that negative number. In this question the numbers list will always contain at least one negative number. Graded n [ ]: def first_negative(numbers): num= numbers [0] ### BEGIN SOLUTION Code ### END SOLUTION return num Read Only n [ ]: inlist1 = [1, 4, -22, -39, 1, 8, 27, 6, 27, -12] a1 = -22 assert al == first_negative(inlist1) Read Only n [ ]: inlist2 = (-29, -1, 49, -33, 49, -40, -7, 33, 36, 41] a2 = -29 assert a2 == first_negative(inlist2)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
