Rationalising gives . You will write both forms and let the computer check that they agree.
The idea. Two decimals that should be equal can differ in the last digit, so compare them with a tiny allowance: abs(x - y) < 1e-12.
Your tasks.
new_bottom, return .rationalised, return .agree with True or False for each pair in pairs: do the two forms agree?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…