You will test whether points lie on a circle, using the distance from its centre.
Your tasks.
on_circle, return True when the point p is at distance r from centre, and False if not. Allow a tiny error: compare with abs(... - r) < 1e-9.count_on_circle, return how many of the points lie on the circle.n_on to how many of the six listed points lie on the circle with centre and radius . Use your function.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…