Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Index problem

I am absolutely confused to ask a question that I think to have asked a lot of time but each time I am confused.

I have this simple code

x = list(var('x_%i' % i) for i in (0..1))
show(x)
Ineq = [x[1] + x[0] <= -2, x[1] >=0,x[0] >=0]
show(Ineq)
type(Ineq[0])
sol0=solve_ineq([x[0] + x[1] <= -2, x[1] >=0,x[0] >=0],[x[0],x[1]])
sol0

If I replace (0..1) by (1..2) whith the correction for the x[i], I have an error of the type list index out of range. Why ?