Construct orhogonal polynomials using Python