Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

y must belong to the base ring of the polynomial. Hence a simple fix in this case is to define T over SR rather than QQ:

y = var("y")
T = PolynomialRing(SR, 'x')
f = T.lagrange_polynomial([(0,y),(2,2)])
print(f)