TypeError: 'float' object has no attribute '__getitem__',python
<p>How do I fix this?</p>

<pre><code>Traceback (most recent call last):
File "l3.py", line 45, in &lt;module&gt;
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__'
</code></pre>