Skip to content

Instantly share code, notes, and snippets.

@jamak
Created December 11, 2012 22:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamak/4262902 to your computer and use it in GitHub Desktop.
Save jamak/4262902 to your computer and use it in GitHub Desktop.
from string import whitespace
from operator import mul
data = open('number.dat') # Number pasted to file.
digits = [int(c) for line in data for c in line if c not in whitespace]
print max([reduce(mul, digits[i:i+5]) for i in range(len(digits)-5)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment