Created
January 21, 2016 08:42
-
-
Save yask123/2c42935e99e6e5ab7ad1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ls = [-1, -2, 1, 3, 2] | |
maxx = ls[0]*ls[1]*ls[2] | |
for i in range(len(ls)-2): | |
prod=1 | |
for j in range(i,i+3): | |
prod*=ls[j] | |
if maxx < prod: | |
maxx = prod | |
print maxx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment