A whole-number zero of a polynomial with whole-number coefficients, and in front of the top power, must divide the constant term. You will list the divisors, test them, and write the factors.
The idea. Test each divisor of the constant term, and also . Every one that gives is a zero, and is a factor.
Your tasks.
divisors, return the positive divisors of n, using its size abs(n).whole_zeroes, return the sorted list of whole-number zeroes.zeroes for .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…
With Standard, you also open 10 more problems, 3 Python labs and 1 extra course. Everything you have used here stays free, always.