我該如何解決這個問題?TypeError:'float'對象沒有屬性'__getitem __',python
Traceback (most recent call last):
File "l3.py", line 45, in <module>
z = solve_minmax(n, a, B, x_min=-1000, x_max=1000)
File "l3.py", line 33, in solve_minmax
dot_B_x = pulp.lpSum([B[i][j] * x[j] for j in range(n)])
TypeError: 'float' object has no attribute '__getitem__'
可能要在這裏發佈的代碼? – TuanDT
你應該顯示一些代碼 –