Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- num = raw_input("Enter Stock numbers: ").split(" ")
- z=len(num)
- def GMP(n):
- least=0
- profit=0
- index=0
- for i in range(z):
- profit += int(n[i])
- if least>profit:
- least=profit
- end=i
- else:
- if profit >= 0:
- profit=0
- index= i+1
- return least, index, end
- print GMP(num)
Advertisement
Add Comment
Please, Sign In to add comment