ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 30 Oct 2013 05:43:42 +0100Sage showed "TypeError: need a summation variable" when i used sum function with for loophttps://ask.sagemath.org/question/10674/sage-showed-typeerror-need-a-summation-variable-when-i-used-sum-function-with-for-loop/I try to make a summation list and the commands are below this:
> sage: var('n')
>
> sage: var('x')
>
> sage: f = (2/n)\*(sin(n\*x)\*(-1)^(n+1))
>
> sage: funclist = [sum(f,n,1,20) for n
> in range(1,3)]
but i found an error message:
> TypeError: need a summation variable
How to solve this problem?
terces907Wed, 30 Oct 2013 05:43:42 +0100https://ask.sagemath.org/question/10674/