Question: In Python. #1. please write a function called stocksell, #2. the input parameters are the price list (l) and the ith day,i from [0, 7],

In Python.

#1. please write a function called "stocksell", #2. the input parameters are the price list (l) and the ith day,i from [0, 7], #3. the return value is the jth day you should sell to make the most profit, #4. print the profit

#for example a = stocksell(l, 2) then a = 6 #(2nd day price is 32, selling day is 6th day, price is 35)

l = [34,47,32, 28, 29, 31, 35,34]

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!