Question: In Python, please and thank you [10 points] Write a recursive function called positive product with a single parameter L, which is a list of
In Python, please and thank you
[10 points] Write a recursive function called positive product with a single parameter L, which is a list of non-zero integers. The function returns True if the product of all integers in L is positive and False otherwise. We assume that the list has length at least 2. The base case occurs when L has length 2. For example, if L = [-4, 9, -9, -6, 1, -2, 1, -1], positive product(L) returns False. If L = [-5, -4], positive product(L) returns True. Your function implementation should consist only of if-else statements, list index [] and slice [:] operators, and recursive calls to positive product. There should not be any loops (for or while) in your implementation. You may not use any built-in functions other than len.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
