A fractional power is the -th root of , raised to the power . You will find whole roots, use them for fractional powers, and build a row of powers of .
The idea. For a perfect power, round(a ** (1 / n)) gives the root exactly. Then raise it to the power , which may be negative.
Your tasks.
nth_root, return the whole -th root of a.frac_power, return , the root first and then the power.row with 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…