You will write a small tool that decides whether two triangles are similar from their corners, and finds the scale factor.
Your tasks.
sorted_sides, return the three side lengths of the triangle p, q, r, from shortest to longest.are_similar, return True when the sides of t1 and t2, shortest to shortest, are all in the same ratio.scale_factor, return the scale factor from t1 to t2 when they are similar, and None when they are not.answer to the scale factor from the triangle with corners to the triangle with corners .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…