import random
l = [random.randint(0, 1000) for x in range(0, 1000)]
i = 2
length = (len(l))
maximum = l[0]*l[1]
y, z = 0, 1
while i < length:
x = l[i] * l[i-1]
if maximum < x:
maximum = x
y = i-1
z = i
i += 1
print(maximum)
print(y, z)
Объяснение:
import random
l = [random.randint(0, 1000) for x in range(0, 1000)]
i = 2
length = (len(l))
maximum = l[0]*l[1]
y, z = 0, 1
while i < length:
x = l[i] * l[i-1]
if maximum < x:
maximum = x
y = i-1
z = i
i += 1
print(maximum)
print(y, z)
Объяснение: