from functools import reduce from operator import mul d = [int(x) for x in ''.join(line.strip() for line in open('pe8.txt'))] dL = len(d) L = int(input('Enter a set length (0 > L > '+str(dL)+')? ')) print ('Greatest product of', L, 'consecutive digits = ', end='') print ("None." if L>dL else \ max(reduce(mul, d[i:i+L]) for i in range(dL-L+1)))