Help me with python 3 problems This is a recursion section P

Help me with python! (3 problems)

This is a recursion section! Please make sure your code works in .py file!

Solution

def Product(lst):
   if(len(lst)==1):
       return lst[0]
   return lst[0]*Product(lst[1:])
def Min(lst):
   if(len(lst)==0):
       print(\"No numbers in the list\")
       return -1
   ans = lst[0]
   for i in range(1,len(lst)):
       if lst[i]<ans:
           ans = lst[i]
   return ans
a = Product([3,6,2])
print(a)
a = Min([11,2,3,4,5,1])
print(a)

Help me with python! (3 problems) This is a recursion section! Please make sure your code works in .py file!Solutiondef Product(lst): if(len(lst)==1): return ls

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site