例如,我想解决
(来源:texify.com)
这是我尝试过的:
from sympy import var, solve
x = var('x')
f = lambda N: sum( n**2 for n in range(1,N+1) )
f(x)
# output:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 1, in <lambda>
TypeError: range() integer end argument expected, got Add.