First time here? Check out the FAQ!
answered 2023-06-07 16:22:17 +0100
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
T
SR
QQ
y = var("y") T = PolynomialRing(SR, 'x') f = T.lagrange_polynomial([(0,y),(2,2)]) print(f)