def maxproduct(number, digits):
    """Calculate the maximum product of the n-adjacent digits of number."""
zeros = 0
product = 1
result = 0
for x in number[:digits]:
    x = int(x)
if x:
    product *= int(x)
else:
    zeros += 1
if not zeros:
    result = product
for i in range(digits, len(number)):
    x = int(number[i - digits])
y = int(number[i])
if x:
    product //= x
else:
    zeros -= 1
if y:
    product *= y
else:
    zeros += 1
if not zeros and product > result:
    result = product
return result
Самый большой продукт в серии на питоне