【发布时间】:2011-09-11 09:28:09
【问题描述】:
为什么我在尝试解决 Project Euler 问题 11 时从代码的第 5 行收到此错误?
for x in matrix:
p = 0
for y in x:
if p < 17:
currentProduct = int(y) * int(x[p + 1]) * int(x[p + 2]) * int(x[p + 3])
if currentProduct > highestProduct:
print(currentProduct)
highestProduct = currentProduct
else:
break
p += 1
'generator' object is not subscriptable
【问题讨论】: