Suppose we want to find the polynomial of degree at most 3 that passes through the points
R=PolynomialRing(GF(37),"x")
f=R.lagrange_polynomial([(1,1),(2,2),(3,21), (5,12)]);f
This evaluates to
22*x^3 + 25*x^2 + 31*x + 34
If we want the constant term:
f(0)
43