You will write three functions that find the limit of a fraction of polynomials as by comparing the degrees. A polynomial is stored as a list of coefficients, highest power first. For example [3, 5, 0] means .
The idea. The degree is the highest power that has a non-zero coefficient. If the top has the lower degree, the limit is . If the degrees are equal, the limit is the ratio of the leading coefficients. If the top has the higher degree, there is no finite limit.
Your tasks.
degree(coeffs). Skip leading zeros, and return the highest power that has a non-zero coefficient.limit_at_infinity(top, bottom). Return the limit as a number, or the word "none" when there is no finite limit.value(coeffs, x). Return the value of the polynomial at x.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…