Posts

Showing posts from April, 2021

Stock Buy and Sell to earn Maximize Profit programme in Python

Stock Buy and Sell to earn Maximize Profit programme in Python def sell_profit(price,n):          i =  0      while (i<n- 1 ):         """We check if next price is less so we use next price becaue we need minimum           buy amount."""          while (i<(n- 1 )  and  price[i+ 1 ] <= price[i]):             i +=  1          if  i == n- 1 :              break         buy = i          i +=  1                     """we check if previo...