[sage-support] Re: Symbolic Calculation in Sage

2012-12-14 Thread Nils Bruin
On Friday, December 14, 2012 12:41:57 PM UTC-8, Keshav Kini wrote: > > Santanu Sarkar > writes: > > > No, as s will be a function of a,m,t, > > You can't have imperative code in a symbolic function, if that's what > you're asking. You can of course use an imperative (Python) function to > do w

[sage-support] Re: Symbolic Calculation in Sage

2012-12-14 Thread Keshav Kini
Santanu Sarkar writes: > No, as s will be a function of a,m,t, You can't have imperative code in a symbolic function, if that's what you're asking. You can of course use an imperative (Python) function to do what you want:: def s(m, a, t): result = 0 for i in srange(1,m+1):