princennamdi

Stock

Nov 14th, 2012
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. num = raw_input("Enter Stock numbers: ").split(" ")
  2. z=len(num)
  3. def GMP(n):
  4.     least,profit=0,0
  5.     for i in range(z):
  6.         profit += int(n[i])
  7.         if least > profit: least=profit
  8.         else:
  9.             if profit > 0: profit=0
  10.     return least
  11. print GMP(num)
Advertisement
Add Comment
Please, Sign In to add comment