8.py
436 Bytes
#!/usr/bin/python
import sys;
import math;
def fiveDigitProduct(num,offset):
sum = 1;
for i in range(offset,offset+5):
sum *= int(num[i]);
return sum;
def greatestProduct(num):
higherProduct = 0;
for i in range (0, len(num)-4):
product = fiveDigitProduct(num,i);
if(product > higherProduct):
higherProduct = product;
return higherProduct;
strNum = sys.argv[1];
print "Result is: " + str(greatestProduct(strNum));