On Sat, Dec 1, 2012 at 8:22 PM, Rishabh Dixit <rishabhdixi...@gmail.com> wrote:
>>>> for i in range(10):
> ...  Sum(1/(ls[i]**ls[i]),(ls[i],1,oo)).evalf()
> ...
>
>>>> solve([ls[0]+5*ls[1]-2,-3*ls[0]+6*ls[1]-15])
> {a0: -3, a1: 1}

Rishabh, basically the difference between what you are saying and I am
saying is, in the first example above you are still using i as a name
for Python builtin integer above and not a symbolic object and in the
second example, you're not using any symbolic i at all. Python lists
can take integer indices just fine. They can't take symbolic indices.
Try:

avals=list(symbols('a:10'))
i=symbols('i',integer=True)
print(summation(avals[i],(i,0,9)))

and you will see what I am talking about.

-- 
Shriramana Sharma

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to