Elim Qiu on Sat, 16 Sep 2017 17:19:07 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: how to define a function with loop |
I'd like to define a function returns the decimal approximation of(1^n+2^n+...+n^n)/(n^n)In python i havedef tm(n,k):return exp(n*log((k+0.0)/n))def sm(n,m):s = 0.0for j in range(m):k = n -js += tm(n,k)return sHow do I put a loop inside of a definition of pari function?Thanks