Assigning variables in a list
I have a variables list which I use to construct a system of linear equations then I use sage to solve this system. Before I use the solve command I like to equate some of the variables in the list. For example if V is the following list var('x,y,z,w,a,b,c,d')
V2=[x,y,z,w,a,b,c,d]
I would like to assignV[i]=V[7-i] for i in [0..3]
. When I do this I get invalid syntax error. I know that I could easily set x=d, y=c and so on but this is not feasible when the list has too many items in it. Thank you for your help!
It seems you are confusing Python variables and symbolic variables, but i am not sure. In order to understand your question better (and provide an adequate solution), could you please provide an example of system of equations you would like to solve, and how you built it in Sage ?
That is probably true since I am very new to Python and to programming in general. The code I used is a bit lengthy so I will try to explain in words what I need. I basically want Sage to assume V[i]=V[7-i] for i in range(j) when solving the system. I tried to use the assume command but wasnt successful.